Commit f965ead8 authored by Pavel Emelyanov's avatar Pavel Emelyanov

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: 's avatarPavel Emelyanov <xemul@parallels.com>
parent d2718506
...@@ -169,7 +169,7 @@ err: ...@@ -169,7 +169,7 @@ err:
static int recv_pipe_fd(struct pipe_info *pi) static int recv_pipe_fd(struct pipe_info *pi)
{ {
struct fdinfo_list_entry *fle; struct fdinfo_list_entry *fle;
char path[PATH_MAX]; char path[32];
int tmp, fd; int tmp, fd;
fle = file_master(&pi->d); fle = file_master(&pi->d);
...@@ -184,7 +184,7 @@ static int recv_pipe_fd(struct pipe_info *pi) ...@@ -184,7 +184,7 @@ static int recv_pipe_fd(struct pipe_info *pi)
} }
close(fd); 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); fd = open(path, pi->pe.flags);
close(tmp); close(tmp);
......
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