aboutgitcodebugslistschat
path: root/repair.c
diff options
context:
space:
mode:
Diffstat (limited to 'repair.c')
-rw-r--r--repair.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/repair.c b/repair.c
index 69c5307..3e0e3e0 100644
--- a/repair.c
+++ b/repair.c
@@ -87,7 +87,7 @@ int repair_listen_handler(struct ctx *c, uint32_t events)
/* Another client is already connected: accept and close right away. */
if (c->fd_repair != -1) {
int discard = accept4(c->fd_repair_listen, NULL, NULL,
- SOCK_NONBLOCK);
+ SOCK_NONBLOCK | SOCK_CLOEXEC);
if (discard == -1)
return errno;
@@ -99,7 +99,8 @@ int repair_listen_handler(struct ctx *c, uint32_t events)
return EEXIST;
}
- if ((c->fd_repair = accept4(c->fd_repair_listen, NULL, NULL, 0)) < 0) {
+ if ((c->fd_repair = accept4(c->fd_repair_listen, NULL, NULL,
+ SOCK_CLOEXEC)) < 0) {
rc = errno;
debug_perror("accept4() on TCP_REPAIR helper listening socket");
return rc;