mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-07-25 02:58:54 +00:00
restore: Don't close LAST_PID_PATH descriptor if it was not opened
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
parent
fe1cf26085
commit
644e4fec6b
1 changed files with 3 additions and 3 deletions
|
|
@ -1257,7 +1257,7 @@ static inline int fork_with_pid(int pid, unsigned long ns_clone_flags)
|
|||
|
||||
if (flock(ca.fd, LOCK_EX)) {
|
||||
pr_perror("%d: Can't lock %s", pid, LAST_PID_PATH);
|
||||
goto err;
|
||||
goto err_close;
|
||||
}
|
||||
|
||||
if (write_img_buf(ca.fd, buf, strlen(buf)))
|
||||
|
|
@ -1273,11 +1273,11 @@ err_unlock:
|
|||
if (flock(ca.fd, LOCK_UN))
|
||||
pr_perror("%d: Can't unlock %s", pid, LAST_PID_PATH);
|
||||
|
||||
err_close:
|
||||
close_safe(&ca.fd);
|
||||
err:
|
||||
if (stack != MAP_FAILED)
|
||||
munmap(stack, STACK_SIZE);
|
||||
|
||||
close_safe(&ca.fd);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue