Skip to content

Commit

Permalink
Don't close handles more than once.
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed May 31, 2009
1 parent 5997dcb commit df382f1
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions nph-offload.c
Expand Up @@ -1301,13 +1301,17 @@ static pid_t cacheFork(const int sock, FILE *cacheio, const int64 max)

#if GLISTENPORT
if (GSocket != -1)
{
close(GSocket);
GSocket = -1;
} // if
#endif

fclose(stdin);
fclose(stdout);
fclose(stderr);
stdin = stderr = stdout = NULL;
if (stdin) fclose(stdin);
if (stdout) fclose(stdout);
if (stderr) fclose(stderr);
stdin = stdout = stderr = NULL;

chdir("/");
setsid();

Expand Down

0 comments on commit df382f1

Please sign in to comment.