From: Luke Mewburn Date: Sat, 10 Jun 2023 10:21:17 +0000 (+0100) Subject: Linux: use statvfs for name_max if available X-Git-Tag: v3.7.0~56 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d955533a6fccac1c1b783e3b0bf8bde8600f1237;p=thirdparty%2Flibarchive.git Linux: use statvfs for name_max if available If using HAVE_STATVFS, set name_max from svfs.f_namelen instead of sfs.f_namelen, to be consistent with the rest of the function. Noticed by code inspection. --- diff --git a/libarchive/archive_read_disk_posix.c b/libarchive/archive_read_disk_posix.c index 5a94ec5d4..91f42b168 100644 --- a/libarchive/archive_read_disk_posix.c +++ b/libarchive/archive_read_disk_posix.c @@ -1860,7 +1860,11 @@ setup_current_filesystem(struct archive_read_disk *a) #if defined(USE_READDIR_R) /* Set maximum filename length. */ +#if defined(HAVE_STATVFS) + t->current_filesystem->name_max = svfs.f_namelen; +#else t->current_filesystem->name_max = sfs.f_namelen; +#endif #endif return (ARCHIVE_OK); }