summaryrefslogtreecommitdiffstats
path: root/src/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/main.c b/src/main.c
index b1f4eeb..2e4439c 100644
--- a/src/main.c
+++ b/src/main.c
@@ -82,6 +82,15 @@ static int create_socket(void) {
82 return -1; 82 return -1;
83 } 83 }
84 84
85 int flags = fcntl(listenfd, F_GETFL, 0);
86 if (flags < 0) {
87 usbmuxd_log(LL_FATAL, "ERROR: Could not get flags for socket");
88 } else {
89 if (fcntl(listenfd, F_SETFL, flags | O_NONBLOCK) < 0) {
90 usbmuxd_log(LL_FATAL, "ERROR: Could not set socket to non-blocking");
91 }
92 }
93
85 bzero(&bind_addr, sizeof(bind_addr)); 94 bzero(&bind_addr, sizeof(bind_addr));
86 bind_addr.sun_family = AF_UNIX; 95 bind_addr.sun_family = AF_UNIX;
87 strcpy(bind_addr.sun_path, socket_path); 96 strcpy(bind_addr.sun_path, socket_path);