From ede0c59d4b6ef9f43eb1aa285ff6d4b96dba42cb Mon Sep 17 00:00:00 2001 From: Nicolas Williams Date: Wed, 4 Jan 2023 16:05:38 -0600 Subject: [PATCH] ipc: Quiet warning about ignoring fcntl() and chmod() return values --- lib/ipc/server.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/lib/ipc/server.c b/lib/ipc/server.c index 3b7d5254b..5ada75af7 100644 --- a/lib/ipc/server.c +++ b/lib/ipc/server.c @@ -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;