]> Savannah Git Hosting - gnulib.git/commitdiff
mountlist: do not classify a bind-mounted dir entry as "dummy"
authorAndrew Warshall <warshall@99main.com>
Mon, 5 Nov 2012 00:41:15 +0000 (16:41 -0800)
committerJim Meyering <jim@meyering.net>
Mon, 5 Nov 2012 00:55:55 +0000 (16:55 -0800)
* lib/mountlist.c (ME_DUMMY_0): Rename from ME_DUMMY, but omit
the "none"-testing clause.
(ME_DUMMY) [MOUNTED_GETMNTENT1]: New macro to encapsulate the
exception for bind-mounted directories.
Copyright-paperwork-exempt: Yes

ChangeLog
lib/mountlist.c

index 720b7a276dec22db701d68999f3f1e87dd383f5d..2173fb26228851bc8adc741f6e9e1d4f9bdabf32 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2012-11-04  Andrew Warshall  <warshall@99main.com>  (tiny change)
+
+       mountlist: do not classify a bind-mounted dir entry as "dummy"
+       * lib/mountlist.c (ME_DUMMY_0): Rename from ME_DUMMY, but omit
+       the "none"-testing clause.
+       (ME_DUMMY) [MOUNTED_GETMNTENT1]: New macro to encapsulate the
+       exception for bind-mounted directories.
+
 2012-11-01  Akim Demaille  <akim@lrde.epita.fr>
 
        quote: provide a means to escape strings with nul characters
index 67154b88d87178851c8c0f8dc7adf3c1594c7bb7..a9a9f2c7fa84fc4ee264095adbf9b591099bd59c 100644 (file)
 #undef opendir
 #undef closedir
 
-#ifndef ME_DUMMY
-# define ME_DUMMY(Fs_name, Fs_type)             \
-    (strcmp (Fs_type, "autofs") == 0            \
-     || strcmp (Fs_type, "none") == 0           \
-     || strcmp (Fs_type, "proc") == 0           \
-     || strcmp (Fs_type, "subfs") == 0          \
-     /* for NetBSD 3.0 */                       \
-     || strcmp (Fs_type, "kernfs") == 0         \
-     /* for Irix 6.5 */                         \
-     || strcmp (Fs_type, "ignore") == 0)
+#define ME_DUMMY_0(Fs_name, Fs_type)            \
+  (strcmp (Fs_type, "autofs") == 0              \
+   || strcmp (Fs_type, "proc") == 0             \
+   || strcmp (Fs_type, "subfs") == 0            \
+   /* for NetBSD 3.0 */                         \
+   || strcmp (Fs_type, "kernfs") == 0           \
+   /* for Irix 6.5 */                           \
+   || strcmp (Fs_type, "ignore") == 0)
+
+/* Historically, we have marked as "dummy" any file system of type "none",
+   but now that programs like du need to know about bind-mounted directories,
+   we grant an exception to any with "bind" in its list of mount options.
+   I.e., those are *not* dummy entries.  */
+#ifdef MOUNTED_GETMNTENT1
+# define ME_DUMMY(Fs_name, Fs_type, Fs_ent)    \
+  (ME_DUMMY_0 (Fs_name, Fs_type)               \
+   || (strcmp (Fs_type, "none") == 0           \
+       && !hasmntopt (Fs_ent, "bind")))
+#else
+# define ME_DUMMY(Fs_name, Fs_type)            \
+  (ME_DUMMY_0 (Fs_name, Fs_type) || strcmp (Fs_type, "none") == 0)
 #endif
 
 #ifdef __CYGWIN__