summaryrefslogtreecommitdiffstats
path: root/client.c
diff options
context:
space:
mode:
Diffstat (limited to 'client.c')
-rw-r--r--client.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/client.c b/client.c
index 91e084a5..f247d059 100644
--- a/client.c
+++ b/client.c
@@ -523,7 +523,7 @@ client_write_open(void *data, size_t datalen)
errno = EBADF;
else {
cf->fd = dup(msg->fd);
- if (client_flags & CLIENT_CONTROL)
+ if (~client_flags & CLIENT_CONTROL)
close(msg->fd); /* can only be used once */
}
}
@@ -678,7 +678,8 @@ client_read_open(void *data, size_t datalen)
errno = EBADF;
else {
cf->fd = dup(msg->fd);
- close(msg->fd); /* can only be used once */
+ if (~client_flags & CLIENT_CONTROL)
+ close(msg->fd); /* can only be used once */
}
}
if (cf->fd == -1) {