ssld: avoid clang static analysis warning

Edit by @aaronmdjones: fix for loop initialisation and inner condition
This commit is contained in:
Simon Arlott 2017-07-29 20:29:24 +01:00
parent b582b00585
commit 4f8866f680
No known key found for this signature in database
GPG key ID: C8975F2043CA5D24

View file

@ -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)