Skip to content

Commit

Permalink
Merge pull request #59 from nunofernandes/master
Browse files Browse the repository at this point in the history
Check fork syscall return value. Log it if we got an error
  • Loading branch information
beave committed Nov 23, 2015
2 parents e290341 + 300a9e0 commit 57569d1
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/output-plugins/sagan-external.c
Expand Up @@ -129,10 +129,11 @@ Syslog Priority:%s\n\
Sagan_Log(S_ERROR, "[%s, line %d] Cannot create output pipe!", __FILE__, __LINE__);
}


if (( pid = fork()) == 0 )
pid=fork();
if ( pid < 0 ) {
Sagan_Log(S_ERROR, "[%s, line %d] Cannot create external program process", __FILE__, __LINE__);
} else if ( pid == 0 )
{

/* Causes problems with alert.log */

close(0);
Expand Down

0 comments on commit 57569d1

Please sign in to comment.