diff options
author | Eric Wong <normalperson@yhbt.net> | 2013-05-06 22:35:06 +0000 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2013-05-06 22:35:18 +0000 |
commit | 0c918c095d8f611f8d0072db468e37683597ef01 (patch) | |
tree | 4b41bc94b5a360ba92b93fffe4aea210796024e2 /svc.c | |
parent | f80c52cfe4e08fba39995830a3fcf5835d0bb846 (diff) | |
download | cmogstored-0c918c095d8f611f8d0072db468e37683597ef01.tar.gz |
There's no reason to be referencing FDs for these acceptors since they're infrequently accessed by svc, so this should make our internals more consistent. This also removes our use of mog_fd_get (outside of test code).
Diffstat (limited to 'svc.c')
-rw-r--r-- | svc.c | 13 |
1 files changed, 6 insertions, 7 deletions
@@ -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)); } /* |