summaryrefslogtreecommitdiff
path: root/src/fdholder
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2023-04-07 15:22:11 +0000
committerLaurent Bercot <ska@appnovation.com>2023-04-07 15:22:11 +0000
commit146da0d33300e8200537fb9b73ce1985a338f746 (patch)
tree16af5c8e44bd5f93fd06624f8303b90f132f4a42 /src/fdholder
parent763cabcda00c56c9644989a310dbbe3bc8502862 (diff)
downloads6-146da0d33300e8200537fb9b73ce1985a338f746.tar.xz
Simplify selfpipe management
Signed-off-by: Laurent Bercot <ska@appnovation.com>
Diffstat (limited to 'src/fdholder')
-rw-r--r--src/fdholder/s6-fdholderd.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/fdholder/s6-fdholderd.c b/src/fdholder/s6-fdholderd.c
index 073f7bf..d357127 100644
--- a/src/fdholder/s6-fdholderd.c
+++ b/src/fdholder/s6-fdholderd.c
@@ -645,7 +645,6 @@ static inline int new_connection (int fd, regex_t *rre, regex_t *wre, unsigned i
int main (int argc, char const *const *argv, char const *const *envp)
{
- int spfd ;
int flag1 = 0 ;
uint32_t maxconn = 16 ;
PROG = "s6-fdholderd" ;
@@ -700,8 +699,7 @@ int main (int argc, char const *const *argv, char const *const *envp)
strerr_dief1sys(100, "called with option -1 but stdout said") ;
}
else close(1) ;
- spfd = selfpipe_init() ;
- if (spfd < 0) strerr_diefu1sys(111, "selfpipe_init") ;
+ if (selfpipe_init() == -1) strerr_diefu1sys(111, "selfpipe_init") ;
if (!sig_ignore(SIGPIPE)) strerr_diefu1sys(111, "ignore SIGPIPE") ;
{
sigset_t set ;
@@ -743,7 +741,7 @@ int main (int argc, char const *const *argv, char const *const *envp)
avltreen_init(&fddeadlineinfo, fddeadlinestorage, fddeadlinefreelist, maxfds, &fds_deadline_dtok, &fds_deadline_cmp, 0) ;
fds_by_deadline = &fddeadlineinfo ;
- x[0].fd = spfd ; x[0].events = IOPAUSE_READ ;
+ x[0].fd = selfpipe_fd() ; x[0].events = IOPAUSE_READ ;
x[1].fd = 0 ;
if (flag1)