2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-22 09:58:09 +00:00

util: Shorten array for anon_inode link checking

Strictly speaking the fd link can point to PATH_MAX string, but for the sake of
is_anonfd_link 32 bytes is enough -- even if the target string is longer it will not
match the required anon_inode:xxx string.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
Pavel Emelyanov 2012-07-11 12:58:46 +04:00
parent f965ead8b8
commit 12a0462f7e

2
util.c
View File

@ -281,7 +281,7 @@ bool is_anon_inode(struct statfs *statfs)
int is_anon_link_type(int lfd, char *type) int is_anon_link_type(int lfd, char *type)
{ {
char link[PATH_MAX], aux[32]; char link[32], aux[32];
ssize_t ret; ssize_t ret;
snprintf(aux, sizeof(aux), "/proc/self/fd/%d", lfd); snprintf(aux, sizeof(aux), "/proc/self/fd/%d", lfd);