From 8ecb454bf7643d08f93f9fdca7147ae84ecf1932 Mon Sep 17 00:00:00 2001 From: Pavel Emelyanov Date: Thu, 29 Mar 2012 16:37:49 +0400 Subject: [PATCH] dump: Rename try_dump_socket Try meant that it might not be a socket, but with local fds we do know it for sure. Signed-off-by: Pavel Emelyanov --- cr-dump.c | 8 ++------ include/sockets.h | 2 +- sockets.c | 2 +- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/cr-dump.c b/cr-dump.c index 5717785a6..568ec5871 100644 --- a/cr-dump.c +++ b/cr-dump.c @@ -352,12 +352,8 @@ static int dump_one_fd(pid_t pid, int fd, int lfd, goto out_close; } - if (S_ISSOCK(fd_stat.st_mode)) { - err = try_dump_socket(pid, fd, cr_fdset, sk_queue); - if (err) - pr_perror("Failed to open %d", fd); - return err; - } + if (S_ISSOCK(fd_stat.st_mode)) + return dump_socket(pid, fd, cr_fdset, sk_queue); fill_fd_params(pid, fd, lfd, &p); diff --git a/include/sockets.h b/include/sockets.h index b84d63da0..5b775cd1a 100644 --- a/include/sockets.h +++ b/include/sockets.h @@ -22,7 +22,7 @@ struct sk_queue { }; struct cr_fdset; -extern int try_dump_socket(pid_t pid, int fd, const struct cr_fdset *cr_fdset, +extern int dump_socket(pid_t pid, int fd, const struct cr_fdset *cr_fdset, struct sk_queue *queue); extern int collect_sockets(void); diff --git a/sockets.c b/sockets.c index b3a795e12..cc12e7d73 100644 --- a/sockets.c +++ b/sockets.c @@ -381,7 +381,7 @@ err: return -1; } -int try_dump_socket(pid_t pid, int fd, const struct cr_fdset *cr_fdset, +int dump_socket(pid_t pid, int fd, const struct cr_fdset *cr_fdset, struct sk_queue *queue) { struct socket_desc *sk;