From f965ead8b8bbca355dfb4700036b55e80fb2a9dc Mon Sep 17 00:00:00 2001 From: Pavel Emelyanov Date: Wed, 11 Jul 2012 12:57:19 +0400 Subject: [PATCH] pipe: Shorten array for self link path To open /proc/self/fd/%d PATH_MAX array is too long :) We can use shorter. Plus fix the snprintf size argument. Signed-off-by: Pavel Emelyanov --- pipes.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pipes.c b/pipes.c index 96b977ae7..e6ca025d4 100644 --- a/pipes.c +++ b/pipes.c @@ -169,7 +169,7 @@ err: static int recv_pipe_fd(struct pipe_info *pi) { struct fdinfo_list_entry *fle; - char path[PATH_MAX]; + char path[32]; int tmp, fd; fle = file_master(&pi->d); @@ -184,7 +184,7 @@ static int recv_pipe_fd(struct pipe_info *pi) } close(fd); - snprintf(path, PATH_MAX, "/proc/self/fd/%d", tmp); + snprintf(path, sizeof(path), "/proc/self/fd/%d", tmp); fd = open(path, pi->pe.flags); close(tmp);