author | Rich Felker <dalias@aerifal.cx> | 2014年05月29日 21:01:32 -0400 |
---|---|---|
committer | Rich Felker <dalias@aerifal.cx> | 2014年05月29日 21:01:32 -0400 |
commit | dd5f50da6f6c3df5647e922e47f8568a8896a752 (patch) | |
tree | c5ab9a1006d2ab4c449f8fa922ce3237acad30e4 /src/stat/fchmodat.c | |
parent | 2e55da911896a91e95b24ab5dc8a9d9b0718f4de (diff) | |
download | musl-dd5f50da6f6c3df5647e922e47f8568a8896a752.tar.gz |
-rw-r--r-- | src/stat/fchmodat.c | 5 |
diff --git a/src/stat/fchmodat.c b/src/stat/fchmodat.c index 12e7ff0c..afa6d44b 100644 --- a/src/stat/fchmodat.c +++ b/src/stat/fchmodat.c @@ -28,8 +28,9 @@ int fchmodat(int fd, const char *path, mode_t mode, int flag) } __procfdname(proc, fd2); - if (!(ret = __syscall(SYS_stat, proc, &st)) && !S_ISLNK(st.st_mode)) - ret = __syscall(SYS_chmod, proc, mode); + ret = __syscall(SYS_fstatat, AT_FDCWD, proc, &st, 0); + if (!ret && !S_ISLNK(st.st_mode)) + ret = __syscall(SYS_fchmodat, AT_FDCWD, proc, mode); __syscall(SYS_close, fd2); return __syscall_ret(ret); |