Skip to content
This repository has been archived by the owner on Jun 24, 2021. It is now read-only.

Commit

Permalink
ssld: avoid clang static analysis warning
Browse files Browse the repository at this point in the history
Edit by @aaronmdjones: fix for loop initialisation and inner condition
  • Loading branch information
nomis committed Aug 4, 2017
1 parent b582b00 commit 4f8866f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions ssld/ssld.c
Expand Up @@ -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)
Expand Down

0 comments on commit 4f8866f

Please sign in to comment.