X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Fstat%2Ffchmodat.c;h=afa6d44b5401da8caec81c3cb78dea9b344b4748;hb=41421d6beb3f17aa8838f7cdaad9cd16b4c451f6;hp=12e7ff0cd17f90209cfb979c7a7096e2767e052a;hpb=571744447c23f91feb6439948f3a619aca850dfb;p=musl 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);