Mercurial > hg > octave-lyh > gnulib-hg
changeset 17210:c09382013ecb
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.
author | Paul Eggert <eggert@cs.ucla.edu> |
---|---|
date | Mon, 17 Dec 2012 22:15:20 -0800 |
parents | 746b9c1f29d5 |
children | 6cbd4d7cb911 |
files | ChangeLog lib/filemode.c lib/sys_stat.in.h tests/test-sys_stat.c |
diffstat | 4 files changed, 27 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2012-12-17 Paul Eggert <eggert@cs.ucla.edu> + + 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 <adl@lrde.epita.fr> x-to-1: honor $PERL
--- a/lib/filemode.c +++ b/lib/filemode.c @@ -78,7 +78,7 @@ 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';
--- 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)
--- a/tests/test-sys_stat.c +++ b/tests/test-sys_stat.c @@ -49,6 +49,7 @@ 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 @@ #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));