Commit d6d06c9d authored by Pavel Emelyanov's avatar Pavel Emelyanov

Open proc links with O_PATH

These three are like map_files one.
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
Acked-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
parent a3a10c44
......@@ -240,7 +240,7 @@ static int dump_task_exe_link(pid_t pid, MmEntry *mm)
struct fd_parms params;
int fd, ret = 0;
fd = open_proc(pid, "exe");
fd = open_proc_path(pid, "exe");
if (fd < 0)
return -1;
......@@ -263,7 +263,7 @@ static int dump_task_fs(pid_t pid, struct parasite_dump_misc *misc, struct cr_im
fe.has_umask = true;
fe.umask = misc->umask;
fd = open_proc(pid, "cwd");
fd = open_proc_path(pid, "cwd");
if (fd < 0)
return -1;
......@@ -278,7 +278,7 @@ static int dump_task_fs(pid_t pid, struct parasite_dump_misc *misc, struct cr_im
close(fd);
fd = open_proc(pid, "root");
fd = open_proc_path(pid, "root");
if (fd < 0)
return -1;
......
......@@ -94,6 +94,9 @@ extern int do_open_proc(pid_t pid, int flags, const char *fmt, ...);
#define open_proc_rw(pid, fmt, ...) \
__open_proc(pid, O_RDWR, fmt, ##__VA_ARGS__)
#define open_proc_path(pid, fmt, ...) \
__open_proc(pid, O_PATH, fmt, ##__VA_ARGS__)
/* DIR *opendir_proc(pid_t pid, const char *fmt, ...); */
#define opendir_proc(pid, fmt, ...) \
({ \
......
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