From: Mike Frysinger Date: Sun, 28 Feb 2016 18:10:16 +0000 (-0500) Subject: add missing _PC_NAME_MAX checks X-Git-Tag: v3.1.901a~9^2~1^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F663%2Fhead;p=thirdparty%2Flibarchive.git add missing _PC_NAME_MAX checks This file looks for _PC_NAME_MAX in a few places, but not all. Add some ifdefs in setup_current_filesystem too. --- diff --git a/libarchive/archive_read_disk_posix.c b/libarchive/archive_read_disk_posix.c index f48053922..a2f781087 100644 --- a/libarchive/archive_read_disk_posix.c +++ b/libarchive/archive_read_disk_posix.c @@ -1576,6 +1576,7 @@ setup_current_filesystem(struct archive_read_disk *a) #if defined(HAVE_STRUCT_STATFS_F_NAMEMAX) t->current_filesystem->name_max = sfs.f_namemax; #else +# if defined(_PC_NAME_MAX) /* Mac OS X does not have f_namemax in struct statfs. */ if (tree_current_is_symblic_link_target(t)) { if (tree_enter_working_dir(t) != 0) { @@ -1585,6 +1586,9 @@ setup_current_filesystem(struct archive_read_disk *a) nm = pathconf(tree_current_access_path(t), _PC_NAME_MAX); } else nm = fpathconf(tree_current_dir_fd(t), _PC_NAME_MAX); +# else + nm = -1; +# endif if (nm == -1) t->current_filesystem->name_max = NAME_MAX; else