mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Natanael Copa <ncopa@alpinelinux.org>
To: musl@lists.openwall.com
Cc: Natanael Copa <ncopa@alpinelinux.org>
Subject: [PATCH v2] syncfs: return a status integer
Date: Thu,  9 Jul 2015 16:18:30 +0200	[thread overview]
Message-ID: <1436451510-14848-1-git-send-email-ncopa@alpinelinux.org> (raw)
In-Reply-To: <20150709125535.GB24295@port70.net>

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



  reply	other threads:[~2015-07-09 14:18 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-09 11:58 [PATCH] " Natanael Copa
2015-07-09 12:55 ` Szabolcs Nagy
2015-07-09 14:18   ` Natanael Copa [this message]
2015-07-09 16:34 ` Rich Felker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1436451510-14848-1-git-send-email-ncopa@alpinelinux.org \
    --to=ncopa@alpinelinux.org \
    --cc=musl@lists.openwall.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).