mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-07-21 01:06:58 +00:00
log: Fix logfd screwup
Broken by 7aa8e4b6 -- log was not moved to higher fd values.
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
This commit is contained in:
parent
119cee0d16
commit
ba64f87bfa
1 changed files with 6 additions and 7 deletions
13
log.c
13
log.c
|
|
@ -48,8 +48,6 @@ int log_init(const char *output)
|
|||
* requested.
|
||||
*/
|
||||
|
||||
new_logfd = rlimit.rlim_cur - 1;
|
||||
|
||||
if (output) {
|
||||
new_logfd = open(output, O_CREAT | O_WRONLY);
|
||||
if (new_logfd < 0) {
|
||||
|
|
@ -57,11 +55,12 @@ int log_init(const char *output)
|
|||
return -1;
|
||||
}
|
||||
current_logfd = new_logfd;
|
||||
} else {
|
||||
if (reopen_fd_as(new_logfd, current_logfd) < 0)
|
||||
goto err;
|
||||
current_logfd = new_logfd;
|
||||
}
|
||||
} else
|
||||
new_logfd = DEFAULT_LOGFD;
|
||||
|
||||
current_logfd = rlimit.rlim_cur - 1;
|
||||
if (reopen_fd_as(current_logfd, new_logfd) < 0)
|
||||
goto err;
|
||||
|
||||
return 0;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue