Commit 307a5e10 authored by Andrey Vagin's avatar Andrey Vagin Committed by Pavel Emelyanov

pre-dump: avoid sleeping in the open() syscall

For example opening the FIFO blocks until the other end is opened also.

We can use O_PATH to avoid sleeping in the open() call.
Signed-off-by: 's avatarAndrey Vagin <avagin@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 5b564db9
...@@ -416,7 +416,7 @@ static int predump_one_fd(int pid, int fd) ...@@ -416,7 +416,7 @@ static int predump_one_fd(int pid, int fd)
* enightened version without fds draining. * enightened version without fds draining.
*/ */
lfd = open_proc(pid, "fd/%d", fd); lfd = __open_proc(pid, O_PATH | O_RDONLY, "fd/%d", fd);
if (lfd < 0) if (lfd < 0)
return 0; /* That's OK, it can be a socket */ return 0; /* That's OK, it can be a socket */
......
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