* lib/filemode.c (ftypelet): Report 'm' for MPX files.
* lib/sys_stat.in.h (S_ISMPX): New macro.
* tests/test-sys_stat.c: Add tests for MPX files.
---
 ChangeLog             |  7 +++++++
 lib/filemode.c        |  2 +-
 lib/sys_stat.in.h     |  4 ++++
 tests/test-sys_stat.c | 15 +++++++++++++++
 4 files changed, 27 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index e95e443..a2d2b23 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2012-12-17  Paul Eggert  <[email protected]>
+
+       filemode, sys_stat: Handle MPX files a la AIX.
+       * lib/filemode.c (ftypelet): Report 'm' for MPX files.
+       * lib/sys_stat.in.h (S_ISMPX): New macro.
+       * tests/test-sys_stat.c: Add tests for MPX files.
+
 2012-12-16  Alexandre Duret-Lutz  <[email protected]>
 
        x-to-1: honor $PERL
diff --git a/lib/filemode.c b/lib/filemode.c
index ed8c6c9..24ffeae 100644
--- a/lib/filemode.c
+++ b/lib/filemode.c
@@ -78,7 +78,7 @@ ftypelet (mode_t bits)
     return 'C';
   if (S_ISDOOR (bits))
     return 'D';
-  if (S_ISMPB (bits) || S_ISMPC (bits))
+  if (S_ISMPB (bits) || S_ISMPC (bits) || S_ISMPX (bits))
     return 'm';
   if (S_ISNWK (bits))
     return 'n';
diff --git a/lib/sys_stat.in.h b/lib/sys_stat.in.h
index 29ffdf9..e6ca08f 100644
--- a/lib/sys_stat.in.h
+++ b/lib/sys_stat.in.h
@@ -150,6 +150,10 @@
 # endif
 #endif
 
+#ifndef S_ISMPX /* AIX */
+# define S_ISMPX(m) 0
+#endif
+
 #ifndef S_ISNAM /* Xenix */
 # ifdef S_IFNAM
 #  define S_ISNAM(m) (((m) & S_IFMT) == S_IFNAM)
diff --git a/tests/test-sys_stat.c b/tests/test-sys_stat.c
index 0702e04..6d3311a 100644
--- a/tests/test-sys_stat.c
+++ b/tests/test-sys_stat.c
@@ -49,6 +49,7 @@ int a[] =
     S_ISSOCK (S_IFREG),
     S_ISDOOR (S_IFREG),
     S_ISMPB (S_IFREG),
+    S_ISMPX (S_IFREG),
     S_ISNAM (S_IFREG),
     S_ISNWK (S_IFREG),
     S_ISPORT (S_IFREG),
@@ -191,6 +192,20 @@ verify (!S_ISMPB (S_IFSOCK));
 #endif
 
 #ifdef S_IFBLK
+verify (!S_ISMPX (S_IFBLK));
+#endif
+verify (!S_ISMPX (S_IFCHR));
+verify (!S_ISMPX (S_IFDIR));
+verify (!S_ISMPX (S_IFIFO));
+verify (!S_ISMPX (S_IFREG));
+#ifdef S_IFLNK
+verify (!S_ISMPX (S_IFLNK));
+#endif
+#ifdef S_IFSOCK
+verify (!S_ISMPX (S_IFSOCK));
+#endif
+
+#ifdef S_IFBLK
 verify (!S_ISNAM (S_IFBLK));
 #endif
 verify (!S_ISNAM (S_IFCHR));
-- 
1.7.11.7


Reply via email to