about summary refs log tree commit homepage
path: root/svc.c
diff options
context:
space:
mode:
Diffstat (limited to 'svc.c')
-rw-r--r--svc.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/svc.c b/svc.c
index 1b5a812..1bf0d45 100644
--- a/svc.c
+++ b/svc.c
@@ -86,7 +86,6 @@ struct mog_svc * mog_svc_new(const char *docroot)
                 svc_once();
 
         svc = xzalloc(sizeof(struct mog_svc));
-        svc->http_fd = svc->httpget_fd = svc->mgmt_fd = -1;
         svc->docroot = docroot;
         svc->docroot_fd = fd;
         svc->dir = dir;
@@ -119,10 +118,10 @@ size_t mog_svc_each(Hash_processor processor, void *data)
         return rv;
 }
 
-static bool cloexec_disable(int fd)
+static bool cloexec_disable(struct mog_fd *mfd)
 {
-        if (fd >= 0)
-                CHECK(int, 0, mog_set_cloexec(fd, false));
+        if (mfd)
+                CHECK(int, 0, mog_set_cloexec(mfd->fd, false));
         return true;
 }
 
@@ -130,9 +129,9 @@ static bool svc_cloexec_off_i(void *svcptr, void *unused)
 {
         struct mog_svc *svc = svcptr;
 
-        return (cloexec_disable(svc->mgmt_fd)
-                && cloexec_disable(svc->http_fd)
-                && cloexec_disable(svc->httpget_fd));
+        return (cloexec_disable(svc->mgmt_mfd)
+                && cloexec_disable(svc->http_mfd)
+                && cloexec_disable(svc->httpget_mfd));
 }
 
 /*