From a0aeaf15caa9e967f6be1a7b3a3087ff9122c7a9 Mon Sep 17 00:00:00 2001 From: Claudio Takahasi Date: Wed, 24 Jan 2007 19:47:56 +0000 Subject: Moved set_nonblocking to common/dbus.c --- input/input-service.c | 28 +--------------------------- 1 file changed, 1 insertion(+), 27 deletions(-) (limited to 'input/input-service.c') diff --git a/input/input-service.c b/input/input-service.c index f14edfe1..c7c07283 100644 --- a/input/input-service.c +++ b/input/input-service.c @@ -28,7 +28,6 @@ #include #include #include -#include #include #include #include @@ -471,31 +470,6 @@ static const char *create_input_path(uint8_t minor) return path; } -/* FIXME: Move to a common file. It is already used by audio and rfcomm */ -static int set_nonblocking(int fd) -{ - long arg; - - arg = fcntl(fd, F_GETFL); - if (arg < 0) { - error("fcntl(F_GETFL): %s (%d)", strerror(errno), errno); - return -1; - } - - /* Return if already nonblocking */ - if (arg & O_NONBLOCK) - return 0; - - arg |= O_NONBLOCK; - if (fcntl(fd, F_SETFL, arg) < 0) { - error("fcntl(F_SETFL, O_NONBLOCK): %s (%d)", - strerror(errno), errno); - return -1; - } - - return 0; -} - static int l2cap_connect(struct pending_connect *pc, unsigned short psm, GIOFunc cb) { @@ -514,7 +488,7 @@ static int l2cap_connect(struct pending_connect *pc, if (bind(sk, (struct sockaddr *) &addr, sizeof(addr)) < 0) goto failed; - if (set_nonblocking(sk) < 0) + if (set_nonblocking(sk, NULL) < 0) goto failed; memset(&opts, 0, sizeof(opts)); -- cgit