From 97e3051ec51ac5bdcb37a371249360163eaf5709 Mon Sep 17 00:00:00 2001 From: Claudio Takahasi Date: Thu, 25 Jan 2007 17:27:52 +0000 Subject: set_nonblocking: removed err argument --- common/dbus.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'common/dbus.c') diff --git a/common/dbus.c b/common/dbus.c index 92a86e73..bc1125fa 100644 --- a/common/dbus.c +++ b/common/dbus.c @@ -645,16 +645,14 @@ DBusHandlerResult simple_introspect(DBusConnection *conn, return send_message_and_unref(conn, reply); } -int set_nonblocking(int fd, int *err) +int set_nonblocking(int fd) { long arg; arg = fcntl(fd, F_GETFL); if (arg < 0) { - if (err) - *err = errno; error("fcntl(F_GETFL): %s (%d)", strerror(errno), errno); - return -1; + return -errno; } /* Return if already nonblocking */ @@ -663,11 +661,9 @@ int set_nonblocking(int fd, int *err) arg |= O_NONBLOCK; if (fcntl(fd, F_SETFL, arg) < 0) { - if (err) - *err = errno; error("fcntl(F_SETFL, O_NONBLOCK): %s (%d)", strerror(errno), errno); - return -1; + return -errno; } return 0; -- cgit