From 4f8866f680d5c04b0e4a4c2ccca0b1fcb7ef20bc Mon Sep 17 00:00:00 2001 From: Simon Arlott Date: Sat, 29 Jul 2017 20:29:24 +0100 Subject: [PATCH] ssld: avoid clang static analysis warning Edit by @aaronmdjones: fix for loop initialisation and inner condition --- ssld/ssld.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ssld/ssld.c b/ssld/ssld.c index 6584b7e3c..db33486be 100644 --- a/ssld/ssld.c +++ b/ssld/ssld.c @@ -1181,11 +1181,13 @@ main(int argc, char **argv) #ifndef _WIN32 int x; - for(x = 0; x < maxfd; x++) + + for(x = 3; x < maxfd; x++) { - if(x != ctlfd && x != pipefd && x > 2) + if(x != ctlfd && x != pipefd) close(x); } + x = open("/dev/null", O_RDWR); if(x >= 0)