Linux bluetooth development
 help / color / mirror / Atom feed
* [PATCH] Move set_nonblocking function to audio/unix.c
@ 2010-11-04 19:43 Claudio Takahasi
  2010-11-04 19:43 ` [PATCH] Enable GATT over LE link on the attribute client Claudio Takahasi
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Claudio Takahasi @ 2010-11-04 19:43 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Claudio Takahasi

---
 audio/unix.c      |   20 ++++++++++++++++++++
 src/glib-helper.c |   20 --------------------
 src/glib-helper.h |    2 --
 3 files changed, 20 insertions(+), 22 deletions(-)

diff --git a/audio/unix.c b/audio/unix.c
index ad822bd..62eee31 100644
--- a/audio/unix.c
+++ b/audio/unix.c
@@ -27,6 +27,7 @@
 #endif
 
 #include <stdio.h>
+#include <fcntl.h>
 #include <sys/socket.h>
 #include <sys/un.h>
 #include <stdlib.h>
@@ -115,6 +116,25 @@ static void client_free(struct unix_client *client)
 	g_free(client);
 }
 
+static int set_nonblocking(int fd)
+{
+	long arg;
+
+	arg = fcntl(fd, F_GETFL);
+	if (arg < 0)
+		return -errno;
+
+	/* Return if already nonblocking */
+	if (arg & O_NONBLOCK)
+		return 0;
+
+	arg |= O_NONBLOCK;
+	if (fcntl(fd, F_SETFL, arg) < 0)
+		return -errno;
+
+	return 0;
+}
+
 /* Pass file descriptor through local domain sockets (AF_LOCAL, formerly
  * AF_UNIX) and the sendmsg() system call with the cmsg_type field of a "struct
  * cmsghdr" set to SCM_RIGHTS and the data being an integer value equal to the
diff --git a/src/glib-helper.c b/src/glib-helper.c
index b3c5003..9d76626 100644
--- a/src/glib-helper.c
+++ b/src/glib-helper.c
@@ -27,7 +27,6 @@
 
 #include <stdlib.h>
 #include <errno.h>
-#include <fcntl.h>
 #include <unistd.h>
 #include <sys/ioctl.h>
 #include <sys/socket.h>
@@ -113,25 +112,6 @@ static void cache_sdp_session(bdaddr_t *src, bdaddr_t *dst,
 						cached);
 }
 
-int set_nonblocking(int fd)
-{
-	long arg;
-
-	arg = fcntl(fd, F_GETFL);
-	if (arg < 0)
-		return -errno;
-
-	/* Return if already nonblocking */
-	if (arg & O_NONBLOCK)
-		return 0;
-
-	arg |= O_NONBLOCK;
-	if (fcntl(fd, F_SETFL, arg) < 0)
-		return -errno;
-
-	return 0;
-}
-
 struct search_context {
 	bdaddr_t		src;
 	bdaddr_t		dst;
diff --git a/src/glib-helper.h b/src/glib-helper.h
index 8a334e9..e89c2c6 100644
--- a/src/glib-helper.h
+++ b/src/glib-helper.h
@@ -21,8 +21,6 @@
  *
  */
 
-int set_nonblocking(int fd);
-
 typedef void (*bt_callback_t) (sdp_list_t *recs, int err, gpointer user_data);
 typedef void (*bt_destroy_t) (gpointer user_data);
 
-- 
1.7.3.2


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2010-11-05  5:03 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-04 19:43 [PATCH] Move set_nonblocking function to audio/unix.c Claudio Takahasi
2010-11-04 19:43 ` [PATCH] Enable GATT over LE link on the attribute client Claudio Takahasi
2010-11-05  5:03   ` Johan Hedberg
2010-11-04 19:43 ` [PATCH] Fix invalid reference to GATT service structure Claudio Takahasi
2010-11-05  5:03   ` Johan Hedberg
2010-11-05  5:02 ` [PATCH] Move set_nonblocking function to audio/unix.c Johan Hedberg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox