Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Thu,  9 Jul 2015 16:18:30 +0200
From: Natanael Copa <ncopa@...inelinux.org>
To: musl@...ts.openwall.com
Cc: Natanael Copa <ncopa@...inelinux.org>
Subject: [PATCH v2] syncfs: return a status integer

syncfs(2) may fail with EBADF if fd is not a vaild file descriptor. We
need return error to follow glibc ABI.
---
Changes v1 -> v2:
 - use syscall instead of __syscall

 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..bc7d301 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

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.