aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsin <sin@2f30.org>2014-02-07 13:23:34 +0000
committersin <sin@2f30.org>2014-02-07 13:23:34 +0000
commita95e5a956322b7310f72df0016889288f2909ce6 (patch)
tree23b87d9d520a4f799f902f8ddb354a702122b92e
parent8194f460daaa9343ce9863838b14132d0ad8037c (diff)
Don't leak the fifofd if we re-init the fifo
-rw-r--r--sinit.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sinit.c b/sinit.c
index 14ee7ca..0bb6503 100644
--- a/sinit.c
+++ b/sinit.c
@@ -129,6 +129,8 @@ sigfifo(void)
{
if (!fifopath)
return;
+ if (fifofd != -1)
+ close(fifofd);
unlink(fifopath);
umask(0);
if (mkfifo(fifopath, 0600) < 0)