Commit aa2d9208 authored by Andrey Vagin's avatar Andrey Vagin Committed by Pavel Emelyanov

files: use PROC_SELF when a process accesses its /proc/PID

If a process is executed in another pidns, a /proc/PID doesn't link with
the proper process.

This patch fixes a problem like this:
   1: Error (util.c:106): Unable to close fd 33: Bad file descriptor
Signed-off-by: 's avatarAndrey Vagin <avagin@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 9ebb3738
...@@ -938,7 +938,7 @@ int close_old_fds(struct pstree_item *me) ...@@ -938,7 +938,7 @@ int close_old_fds(struct pstree_item *me)
struct dirent *de; struct dirent *de;
int fd, ret; int fd, ret;
dir = opendir_proc(getpid(), "fd"); dir = opendir_proc(PROC_SELF, "fd");
if (dir == NULL) if (dir == NULL)
return -1; 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