Skip to content

Commit

Permalink
Merge pull request #22 from MichalPokorny/master
Browse files Browse the repository at this point in the history
Fix Windows build by defining out Unix-specific code
  • Loading branch information
phokz committed Jan 11, 2016
2 parents ccfc0b1 + fb7afe4 commit 79e5ff0
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion mod_authnz_external/mod_authnz_external.c
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,9 @@ static int exec_external(const char *extpath, const char *extmethod,
const char *t;
int i, status= -4;
apr_exit_why_e why= APR_PROC_EXIT;
#ifndef _WINDOWS
apr_sigfunc_t *sigchld;
#endif

/* Set various flags based on the execution method */

Expand Down Expand Up @@ -503,8 +505,11 @@ static int exec_external(const char *extpath, const char *extmethod,
}

/* Sometimes other modules wil mess up sigchild. Need to fix it for
* the wait call to work correctly. */
* the wait call to work correctly. (However, there's no need to fix
* the handler on Windows, since there are no signals on Windows.) */
#ifndef _WINDOWS
sigchld= apr_signal(SIGCHLD,SIG_DFL);
#endif

/* Start the child process */
rc= apr_proc_create(&proc, child_arg[0],
Expand Down Expand Up @@ -546,7 +551,9 @@ static int exec_external(const char *extpath, const char *extmethod,
rc= apr_proc_wait(&proc,&status,&why,APR_WAIT);

/* Restore sigchild to whatever it was before we reset it */
#ifndef _WINDOWS
apr_signal(SIGCHLD,sigchld);
#endif

if (!APR_STATUS_IS_CHILD_DONE(rc))
{
Expand Down

0 comments on commit 79e5ff0

Please sign in to comment.