diff mbox

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

Message ID 1438006967-18815-4-git-send-email-tytso@mit.edu (mailing list archive)
State New, archived
Headers show

Commit Message

Theodore Ts'o July 27, 2015, 2:22 p.m. UTC
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@mit.edu>
---
 src/lstat64.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

Comments

Christoph Hellwig July 30, 2015, 5:14 p.m. UTC | #1
On Mon, Jul 27, 2015 at 10:22:46AM -0400, Theodore Ts'o wrote:
> 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@mit.edu>

Looks good,

Reviewed-by: Christoph Hellwig <hch@lst.de>
--
To unsubscribe from this list: send the line "unsubscribe fstests" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

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';