]> arthur.barton.de Git - ngircd-alex.git/commitdiff
Fix signalpipe file descriptor leak on RESTART
authorFlorian Westphal <fw@strlen.de>
Tue, 14 Sep 2010 21:53:59 +0000 (23:53 +0200)
committerFlorian Westphal <fw@strlen.de>
Tue, 14 Sep 2010 21:53:59 +0000 (23:53 +0200)
Signals_Init() must only be called once.
This does not affect any ngircd release version.

Earlier version of this patch moved the io and sighandler
initialization before the while() loop, but as Alexander
Barton noticed that broke all systems without builtin select
support in io.c...

src/ngircd/sighandlers.c

index aaff1eabfa2099488ffca7f648fe2eec50a60d33..80eef3e603d3a382f2e31bf8511ce4433c24c218 100644 (file)
@@ -266,6 +266,8 @@ Signals_Init(void)
 #ifdef HAVE_SIGACTION
        struct sigaction saction;
 #endif
+       if (signalpipe[0] > 0 || signalpipe[1] > 0)
+               return true;
 
        if (pipe(signalpipe))
                return false;