From 06d6ee574245abf41e2225c63738929bbd9073d3 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Sun, 28 Feb 2016 13:10:16 -0500 Subject: [PATCH] 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. --- libarchive/archive_read_disk_posix.c | 4 ++++ 1 file changed, 4 insertions(+) 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 -- 2.47.2