mirror of
https://github.com/checkpoint-restore/criu
synced 2025-08-22 09:58:09 +00:00
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 <xemul@parallels.com>
This commit is contained in:
parent
d271850694
commit
f965ead8b8
4
pipes.c
4
pipes.c
@ -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)
|
|||||||
}
|
}
|
||||||
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);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user