[PATCH 3/4] xfstests: use the Posix st_mode defines instead of the obsolete SysV ones

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]



Instead of S_IEXEC, S_IREAD, and S_IWRITE, use the Posix defines of
S_I[WRX]{OTH,GRP,USR}.

Signed-off-by: Theodore Ts'o <tytso@xxxxxxx>
---
 src/lstat64.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/src/lstat64.c b/src/lstat64.c
index 3b68c66..c8a0cc6 100644
--- a/src/lstat64.c
+++ b/src/lstat64.c
@@ -92,23 +92,23 @@ main(int argc, char **argv)
 			printf("  Size: %-10llu", (unsigned long long)sbuf.st_size);
 		}
 
-		if (sbuf.st_mode & (S_IEXEC>>6))
+		if (sbuf.st_mode & S_IXOTH)
 			mode[9] = 'x';
-		if (sbuf.st_mode & (S_IWRITE>>6))
+		if (sbuf.st_mode & S_IWOTH)
 			mode[8] = 'w';
-		if (sbuf.st_mode & (S_IREAD>>6))
+		if (sbuf.st_mode & S_IROTH)
 			mode[7] = 'r';
-		if (sbuf.st_mode & (S_IEXEC>>3))
+		if (sbuf.st_mode & S_IXGRP)
 			mode[6] = 'x';
-		if (sbuf.st_mode & (S_IWRITE>>3))
+		if (sbuf.st_mode & S_IWGRP)
 			mode[5] = 'w';
-		if (sbuf.st_mode & (S_IREAD>>3))
+		if (sbuf.st_mode & S_IRGRP)
 			mode[4] = 'r';
-		if (sbuf.st_mode & S_IEXEC)
+		if (sbuf.st_mode & S_IXUSR)
 			mode[3] = 'x';
-		if (sbuf.st_mode & S_IWRITE)
+		if (sbuf.st_mode & S_IWUSR)
 			mode[2] = 'w';
-		if (sbuf.st_mode & S_IREAD)
+		if (sbuf.st_mode & S_IRUSR)
 			mode[1] = 'r';
 		if (sbuf.st_mode & S_ISVTX)
 			mode[9] = 't';
-- 
2.3.0

--
To unsubscribe from this list: send the line "unsubscribe fstests" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Filesystems Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux