lstat64:: use Posix st_mode defines
[xfstests-dev.git] / src / lstat64.c
index 3b68c66b512ec943aa7768b43c053f6233a1e8b7..c8a0cc6c05b129bde1ce039b8ed9a624a4086f41 100644 (file)
@@ -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';