mailing list of musl libc
 help / color / mirror / code / Atom feed
* [PATCH] syncfs: return a status integer
@ 2015-07-09 11:58 Natanael Copa
  2015-07-09 12:55 ` Szabolcs Nagy
  2015-07-09 16:34 ` [PATCH] " Rich Felker
  0 siblings, 2 replies; 4+ messages in thread
From: Natanael Copa @ 2015-07-09 11:58 UTC (permalink / raw)
  To: musl; +Cc: Natanael Copa

syncfs(2) may fail with EBADF if fd is not a vaild file descriptor. We
need return error to follow glibc ABI.
---
 include/unistd.h   | 2 +-
 src/linux/syncfs.c | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/include/unistd.h b/include/unistd.h
index 0fe75d5..760a165 100644
--- a/include/unistd.h
+++ b/include/unistd.h
@@ -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
diff --git a/src/linux/syncfs.c b/src/linux/syncfs.c
index fe2b8a7..047bcff 100644
--- a/src/linux/syncfs.c
+++ b/src/linux/syncfs.c
@@ -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);
 }
-- 
2.4.5



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-07-09 16:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-09 11:58 [PATCH] syncfs: return a status integer Natanael Copa
2015-07-09 12:55 ` Szabolcs Nagy
2015-07-09 14:18   ` [PATCH v2] " Natanael Copa
2015-07-09 16:34 ` [PATCH] " Rich Felker

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).