summaryrefslogtreecommitdiff
path: root/third_party/heimdal/lib/ipc/server.c
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/heimdal/lib/ipc/server.c')
-rw-r--r--third_party/heimdal/lib/ipc/server.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/third_party/heimdal/lib/ipc/server.c b/third_party/heimdal/lib/ipc/server.c
index 839a596388a..40601b9744f 100644
--- a/third_party/heimdal/lib/ipc/server.c
+++ b/third_party/heimdal/lib/ipc/server.c
@@ -1014,15 +1014,12 @@ process_loop(void)
for (n = 0 ; n < num_fds; n++) {
if (clients[n] == NULL)
continue;
- if (fds[n].revents & POLLERR) {
- clients[n]->flags |= WAITING_CLOSE;
- continue;
- }
-
if (fds[n].revents & POLLIN)
handle_read(clients[n]);
if (fds[n].revents & POLLOUT)
handle_write(clients[n]);
+ if (fds[n].revents & POLLERR)
+ clients[n]->flags |= WAITING_CLOSE;
}
n = 0;
@@ -1055,12 +1052,16 @@ heim_sipc_stream_listener(int fd, int type,
heim_ipc_callback callback,
void *user, heim_sipc *ctx)
{
- heim_sipc ct = calloc(1, sizeof(*ct));
+ heim_sipc ct;
struct client *c;
if ((type & HEIM_SIPC_TYPE_IPC) && (type & (HEIM_SIPC_TYPE_UINT32|HEIM_SIPC_TYPE_HTTP)))
return EINVAL;
+ ct = calloc(1, sizeof(*ct));
+ if (ct == NULL)
+ return ENOMEM;
+
switch (type) {
case HEIM_SIPC_TYPE_IPC:
c = add_new_socket(fd, LISTEN_SOCKET|WAITING_READ|INCLUDE_ERROR_CODE, callback, user);
@@ -1111,7 +1112,7 @@ heim_sipc_service_unix(const char *service,
#ifdef LOCAL_CREDS
{
int one = 1;
- setsockopt(fd, 0, LOCAL_CREDS, (void *)&one, sizeof(one));
+ (void) setsockopt(fd, 0, LOCAL_CREDS, (void *)&one, sizeof(one));
}
#endif