Commit 09a7273e authored by Pavel Emelyanov's avatar Pavel Emelyanov Committed by Cyrill Gorcunov

restore: O_TRUNC file instead of unlink

Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
parent af3616d0
......@@ -693,9 +693,8 @@ static int prepare_and_sigreturn(int pid)
if (get_image_path(path, sizeof(path), FMT_FNAME_CORE_OUT, pid))
return -1;
unlink(path);
fd_new = open(path, O_RDWR | O_CREAT | O_EXCL, CR_FD_PERM);
fd_new = open(path, O_RDWR | O_CREAT | O_TRUNC, CR_FD_PERM);
if (fd_new < 0) {
pr_perror("%d: Can't open new image\n", pid);
return -1;
......
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