summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Holland <samuel@sholland.org>2017-05-27 15:20:01 -0500
committerRich Felker <dalias@aerifal.cx>2017-05-27 22:04:12 -0400
commit81f4a1200a58a84c83e73da645d4f226a8785bdf (patch)
tree502599b53239fdd4051fda952524d1d1c904ff6c
parent97bd6b09dbe7478d5a90a06ecd9e5b59389d8eb9 (diff)
downloadmusl-81f4a1200a58a84c83e73da645d4f226a8785bdf.tar.gz
fix fchown fallback on arches without chown(2)
The flags argument was missing, causing uninitalized data to be passed to fchownat(2). The correct value of flags should match the fallback for chown(3).
-rw-r--r--src/unistd/fchown.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/unistd/fchown.c b/src/unistd/fchown.c
index 03459849..75075eec 100644
--- a/src/unistd/fchown.c
+++ b/src/unistd/fchown.c
@@ -16,7 +16,7 @@ int fchown(int fd, uid_t uid, gid_t gid)
#ifdef SYS_chown
return syscall(SYS_chown, buf, uid, gid);
#else
- return syscall(SYS_fchownat, AT_FDCWD, buf, uid, gid);
+ return syscall(SYS_fchownat, AT_FDCWD, buf, uid, gid, 0);
#endif
}