Commit 644e4fec authored by Cyrill Gorcunov's avatar Cyrill Gorcunov Committed by Pavel Emelyanov

restore: Don't close LAST_PID_PATH descriptor if it was not opened

Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent fe1cf260
...@@ -1257,7 +1257,7 @@ static inline int fork_with_pid(int pid, unsigned long ns_clone_flags) ...@@ -1257,7 +1257,7 @@ static inline int fork_with_pid(int pid, unsigned long ns_clone_flags)
if (flock(ca.fd, LOCK_EX)) { if (flock(ca.fd, LOCK_EX)) {
pr_perror("%d: Can't lock %s", pid, LAST_PID_PATH); 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))) if (write_img_buf(ca.fd, buf, strlen(buf)))
...@@ -1273,11 +1273,11 @@ err_unlock: ...@@ -1273,11 +1273,11 @@ err_unlock:
if (flock(ca.fd, LOCK_UN)) if (flock(ca.fd, LOCK_UN))
pr_perror("%d: Can't unlock %s", pid, LAST_PID_PATH); pr_perror("%d: Can't unlock %s", pid, LAST_PID_PATH);
err_close:
close_safe(&ca.fd);
err: err:
if (stack != MAP_FAILED) if (stack != MAP_FAILED)
munmap(stack, STACK_SIZE); munmap(stack, STACK_SIZE);
close_safe(&ca.fd);
return ret; return ret;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment