/mandos/trunk

To get this branch, use:
bzr branch http://bzr.recompile.se/loggerhead/mandos/trunk

« back to all changes in this revision

Viewing changes to plugin-runner.c

  • Committer: Teddy Hogeborn
  • Date: 2014-06-14 02:55:24 UTC
  • Revision ID: teddy@recompile.se-20140614025524-k03150tjp4t89w1d
plugin-runner: Restore resources correctly if fork() fails.

* plugin-runner.c (main): If fork() fails, close pipe FD's and restore
                          signal mask for SIGCHLD.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1014
1014
    } while(pid == -1 and errno == EINTR);
1015
1015
    if(pid == -1){
1016
1016
      error(0, errno, "fork");
 
1017
      TEMP_FAILURE_RETRY(sigprocmask(SIG_UNBLOCK,
 
1018
                                     &sigchld_action.sa_mask, NULL));
 
1019
      TEMP_FAILURE_RETRY(close(pipefd[0]));
 
1020
      TEMP_FAILURE_RETRY(close(pipefd[1]));
1017
1021
      exitstatus = EX_OSERR;
1018
1022
      goto fallback;
1019
1023
    }