diff options
Diffstat (limited to 'common')
-rw-r--r-- | common/dbus.c | 10 | ||||
-rw-r--r-- | common/dbus.h | 2 |
2 files changed, 4 insertions, 8 deletions
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; diff --git a/common/dbus.h b/common/dbus.h index d59903ee..f2bf45af 100644 --- a/common/dbus.h +++ b/common/dbus.h @@ -51,6 +51,6 @@ static inline DBusHandlerResult send_message_and_unref(DBusConnection *conn, DBu return DBUS_HANDLER_RESULT_HANDLED; } -int set_nonblocking(int fd, int *err); +int set_nonblocking(int fd); #endif /* __H_BLUEZ_DBUS_H__ */ |