diff options
author | Alan Somers <asomers@gmail.com> | 2019-03-08 14:24:50 -0700 |
---|---|---|
committer | Nikolaus Rath <Nikolaus@rath.org> | 2019-03-08 21:24:50 +0000 |
commit | 1b7d2b886265daa5527f487c1b6e86d006574ac4 (patch) | |
tree | 2c936ff4a30e660b93e0399e40689e478ed0758e /test | |
parent | 06a31dece06792fd70fe2b4353f65df02f13549e (diff) | |
download | libfuse-1b7d2b886265daa5527f487c1b6e86d006574ac4.tar.gz |
Document fuse_fsync_in.fsync_flags and remove magic numbers (#375)
Diffstat (limited to 'test')
-rw-r--r-- | test/test_syscalls.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/test/test_syscalls.c b/test/test_syscalls.c index a281ae3..cdf17d7 100644 --- a/test/test_syscalls.c +++ b/test/test_syscalls.c @@ -163,8 +163,9 @@ static int check_mode(const char *path, mode_t mode) PERROR("lstat"); return -1; } - if ((stbuf.st_mode & 07777) != mode) { - ERROR("mode 0%o instead of 0%o", stbuf.st_mode & 07777, mode); + if ((stbuf.st_mode & ALLPERMS) != mode) { + ERROR("mode 0%o instead of 0%o", stbuf.st_mode & ALLPERMS, + mode); return -1; } return 0; @@ -178,8 +179,9 @@ static int fcheck_mode(int fd, mode_t mode) PERROR("fstat"); return -1; } - if ((stbuf.st_mode & 07777) != mode) { - ERROR("mode 0%o instead of 0%o", stbuf.st_mode & 07777, mode); + if ((stbuf.st_mode & ALLPERMS) != mode) { + ERROR("mode 0%o instead of 0%o", stbuf.st_mode & ALLPERMS, + mode); return -1; } return 0; @@ -1040,7 +1042,7 @@ static int do_test_open(int exist, int flags, const char *flags_str, int mode) err += check_mode(testfile, mode); err += check_nlink(testfile, 1); err += check_size(testfile, currlen); - if (exist && !(flags & O_TRUNC) && (mode & 0400)) + if (exist && !(flags & O_TRUNC) && (mode & S_IRUSR)) err += check_data(testfile, testdata2, 0, testdata2len); res = write(fd, data, datalen); @@ -1057,7 +1059,7 @@ static int do_test_open(int exist, int flags, const char *flags_str, int mode) err += check_size(testfile, currlen); - if (mode & 0400) { + if (mode & S_IRUSR) { err += check_data(testfile, data, 0, datalen); if (exist && !(flags & O_TRUNC) && testdata2len > datalen) |