ipc: Quiet warning about ignoring fcntl() and chmod() return values
authorNicolas Williams <nico@twosigma.com>
Wed, 4 Jan 2023 22:05:38 +0000 (16:05 -0600)
committerNicolas Williams <nico@twosigma.com>
Wed, 4 Jan 2023 22:05:38 +0000 (16:05 -0600)
lib/ipc/server.c

index 3b7d5254b5bdd46d0852f52b5f8587dedf1ad7c6..5ada75af7d1348b64c7fcefec73fdd9be1415295 100644 (file)
@@ -606,7 +606,6 @@ add_new_socket(int fd,
               void *userctx)
 {
     struct client *c;
-    int fileflags;
 
     c = calloc(1, sizeof(*c));
     if (c == NULL)
@@ -628,8 +627,7 @@ add_new_socket(int fd,
     c->callback = callback;
     c->userctx = userctx;
 
-    fileflags = fcntl(c->fd, F_GETFL, 0);
-    fcntl(c->fd, F_SETFL, fileflags | O_NONBLOCK);
+    socket_set_nonblocking(fd, 1);
 
 #ifdef HAVE_GCD
     init_globals();
@@ -1118,7 +1116,7 @@ heim_sipc_service_unix(const char *service,
        return errno;
     }
 
-    chmod(un.sun_path, 0666);
+    (void) chmod(un.sun_path, 0666);
 
     ret = heim_sipc_stream_listener(fd, HEIM_SIPC_TYPE_IPC,
                                    callback, user, ctx);
@@ -1287,7 +1285,7 @@ heim_sipc_service_door(const char *service,
         ret = errno;
         goto cleanup;
     }
-    fchmod(dfd, 0666); /* XXX */
+    (void) fchmod(dfd, 0666); /* XXX */
 
     if (fattach(fd, path) < 0) {
         ret = errno;