about summary refs log tree commit diff
path: root/src/stat/fchmodat.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/stat/fchmodat.c')
-rw-r--r--src/stat/fchmodat.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/stat/fchmodat.c b/src/stat/fchmodat.c
index bc581050..92c9d1b0 100644
--- a/src/stat/fchmodat.c
+++ b/src/stat/fchmodat.c
@@ -5,13 +5,16 @@
 
 int fchmodat(int fd, const char *path, mode_t mode, int flag)
 {
-	if (!flag) return syscall(SYS_fchmodat, fd, path, mode, flag);
+	if (!flag) return syscall(SYS_fchmodat, fd, path, mode);
+
+	int ret = __syscall(SYS_fchmodat2, fd, path, mode, flag);
+	if (ret != -ENOSYS) return __syscall_ret(ret);
 
 	if (flag != AT_SYMLINK_NOFOLLOW)
 		return __syscall_ret(-EINVAL);
 
 	struct stat st;
-	int ret, fd2;
+	int fd2;
 	char proc[15+3*sizeof(int)];
 
 	if (fstatat(fd, path, &st, flag))