From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/8143 Path: news.gmane.org!not-for-mail From: Natanael Copa Newsgroups: gmane.linux.lib.musl.general Subject: [PATCH v2] syncfs: return a status integer Date: Thu, 9 Jul 2015 16:18:30 +0200 Message-ID: <1436451510-14848-1-git-send-email-ncopa@alpinelinux.org> References: <20150709125535.GB24295@port70.net> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1436451534 26308 80.91.229.3 (9 Jul 2015 14:18:54 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 9 Jul 2015 14:18:54 +0000 (UTC) Cc: Natanael Copa To: musl@lists.openwall.com Original-X-From: musl-return-8156-gllmg-musl=m.gmane.org@lists.openwall.com Thu Jul 09 16:18:52 2015 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1ZDCf5-00005S-6w for gllmg-musl@m.gmane.org; Thu, 09 Jul 2015 16:18:51 +0200 Original-Received: (qmail 3546 invoked by uid 550); 9 Jul 2015 14:18:49 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 3502 invoked from network); 9 Jul 2015 14:18:43 -0000 X-Mailer: git-send-email 2.4.5 In-Reply-To: <20150709125535.GB24295@port70.net> Xref: news.gmane.org gmane.linux.lib.musl.general:8143 Archived-At: 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 #include "syscall.h" -void syncfs(int fd) +int syncfs(int fd) { - __syscall(SYS_syncfs, fd); + return syscall(SYS_syncfs, fd); } -- 2.4.5