Wed Sep 24 13:53:13 2008 UTC ()
On Linux systems, don't use ext2_fs.h features if we don't have the header.
Fixes build of pkgsrc/archivers/bsdtar on some systems, no functional change
intended on systems that already successfully built.

Ok'd during freeze by joerg@ and agc@


(dsainty)
diff -r1.1.1.5 -r1.2 pkgsrc/archivers/libarchive/files/tar/write.c

cvs diff -r1.1.1.5 -r1.2 pkgsrc/archivers/libarchive/files/tar/write.c (expand / switch to context diff)
--- pkgsrc/archivers/libarchive/files/tar/write.c 2008/07/14 14:52:44 1.1.1.5
+++ pkgsrc/archivers/libarchive/files/tar/write.c 2008/09/24 13:53:13 1.2
@@ -648,7 +648,7 @@
 	dev_t first_dev = 0;
 	int dev_recorded = 0;
 	int tree_ret;
-#ifdef __linux
+#ifdef HAVE_EXT2FS_EXT2_FS_H
 	int	 fd, r;
 	unsigned long fflags;
 #endif
@@ -720,7 +720,7 @@
 			continue;
 #endif
 
-#ifdef __linux
+#ifdef HAVE_EXT2FS_EXT2_FS_H
 		/*
 		 * Linux has a nodump flag too but to read it
 		 * we have to open() the file/dir and do an ioctl on it...
@@ -850,7 +850,7 @@
 {
 	struct archive_entry	*entry, *sparse_entry;
 	int			fd;
-#ifdef __linux
+#ifdef HAVE_EXT2FS_EXT2_FS_H
 	int			 r;
 	unsigned long		 stflags;
 #endif
@@ -909,7 +909,7 @@
 		archive_entry_set_fflags(entry, st->st_flags, 0);
 #endif
 
-#ifdef __linux
+#ifdef HAVE_EXT2FS_EXT2_FS_H
 	if ((S_ISREG(st->st_mode) || S_ISDIR(st->st_mode)) &&
 	    ((fd = open(accpath, O_RDONLY|O_NONBLOCK)) >= 0) &&
 	    ((r = ioctl(fd, EXT2_IOC_GETFLAGS, &stflags)), close(fd), (fd = -1), r) >= 0 &&