fix incorrect void return type for syncfs function
authorRich Felker <dalias@aerifal.cx>
Thu, 9 Jul 2015 17:07:35 +0000 (17:07 +0000)
committerRich Felker <dalias@aerifal.cx>
Thu, 9 Jul 2015 17:07:35 +0000 (17:07 +0000)
being nonstandard, the closest thing to a specification for this
function is its man page, which documents it as returning int. it can
fail with EBADF if the file descriptor passed is invalid.

include/unistd.h
src/linux/syncfs.c

index 0fe75d5..760a165 100644 (file)
@@ -185,7 +185,7 @@ int setresgid(gid_t, gid_t, gid_t);
 int getresuid(uid_t *, uid_t *, uid_t *);
 int getresgid(gid_t *, gid_t *, gid_t *);
 char *get_current_dir_name(void);
-void syncfs(int);
+int syncfs(int);
 int euidaccess(const char *, int);
 int eaccess(const char *, int);
 #endif
index fe2b8a7..bc7d301 100644 (file)
@@ -2,7 +2,7 @@
 #include <unistd.h>
 #include "syscall.h"
 
-void syncfs(int fd)
+int syncfs(int fd)
 {
-       __syscall(SYS_syncfs, fd);
+       return syscall(SYS_syncfs, fd);
 }