From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/8141 Path: news.gmane.org!not-for-mail From: Natanael Copa Newsgroups: gmane.linux.lib.musl.general Subject: [PATCH] syncfs: return a status integer Date: Thu, 9 Jul 2015 13:58:56 +0200 Message-ID: <1436443136-12394-1-git-send-email-ncopa@alpinelinux.org> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1436445331 17683 80.91.229.3 (9 Jul 2015 12:35:31 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 9 Jul 2015 12:35:31 +0000 (UTC) Cc: Natanael Copa To: musl@lists.openwall.com Original-X-From: musl-return-8154-gllmg-musl=m.gmane.org@lists.openwall.com Thu Jul 09 14:35:30 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 1ZDB34-00078t-BV for gllmg-musl@m.gmane.org; Thu, 09 Jul 2015 14:35:30 +0200 Original-Received: (qmail 1396 invoked by uid 550); 9 Jul 2015 12:35:27 -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 11461 invoked from network); 9 Jul 2015 11:59:09 -0000 X-Mailer: git-send-email 2.4.5 Xref: news.gmane.org gmane.linux.lib.musl.general:8141 Archived-At: 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 #include "syscall.h" -void syncfs(int fd) +int syncfs(int fd) { - __syscall(SYS_syncfs, fd); + return __syscall(SYS_syncfs, fd); } -- 2.4.5