Commit 6949e0f0 authored by Andrey Vagin's avatar Andrey Vagin Committed by Cyrill Gorcunov

Dump memory character devices as a file.

It's work for /dev/zero, /dev/null and other simple devices.
Signed-off-by: 's avatarAndrey Vagin <avagin@openvz.org>
Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
parent 75536202
......@@ -20,6 +20,8 @@
#include <sys/sendfile.h>
#include <linux/major.h>
#include "types.h"
#include "list.h"
......@@ -248,7 +250,8 @@ static int dump_one_fd(char *pid_fd_dir, int dir, char *fd_name, unsigned long p
goto err;
}
if (S_ISREG(st_buf.st_mode))
if (S_ISREG(st_buf.st_mode) ||
(S_ISCHR(st_buf.st_mode) && major(st_buf.st_rdev) == MEM_MAJOR))
return dump_one_reg_file(FDINFO_FD, atol(fd_name),
fd, 1, pos, flags, cr_fdset);
......
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