summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Härdeman <david@hardeman.nu>2020-06-10 23:34:29 +0200
committerDavid Härdeman <david@hardeman.nu>2020-06-10 23:34:29 +0200
commit5fb493c99846cb475dab7321a4d835025c96051b (patch)
treef0bd1a23f4a63540d73721ff4aad39d39fd526e9
parent6adb89c30c9e876848fa84774674db0fd05dad8d (diff)
Some more close-on-exec
-rw-r--r--main.c2
-rw-r--r--uring.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/main.c b/main.c
index 0f41ea0..61a6442 100644
--- a/main.c
+++ b/main.c
@@ -74,7 +74,7 @@ cfg_read(struct cfg *cfg)
{
FILE *cfgfile;
- cfgfile = fopen("./mcproxy.conf", "r");
+ cfgfile = fopen("./mcproxy.conf", "re");
if (!cfgfile) {
if (errno == ENOENT)
return;
diff --git a/uring.c b/uring.c
index 26e2073..e6b232e 100644
--- a/uring.c
+++ b/uring.c
@@ -438,7 +438,7 @@ uring_accept(struct cfg *cfg, struct uring_task *task, struct sockaddr_in46 *add
addr->addrlen = sizeof(addr->storage);
uring_task_get(cfg, task);
task->callback = callback;
- io_uring_prep_accept(sqe, task->fd, (struct sockaddr *)&addr->storage, &addr->addrlen, 0);
+ io_uring_prep_accept(sqe, task->fd, (struct sockaddr *)&addr->storage, &addr->addrlen, SOCK_CLOEXEC);
io_uring_sqe_set_data(sqe, task);
}