diff options
Diffstat (limited to 'threadproc')
-rw-r--r-- | threadproc/beos/proc.c | 7 | ||||
-rw-r--r-- | threadproc/unix/proc.c | 7 | ||||
-rw-r--r-- | threadproc/unix/procsup.c | 4 |
3 files changed, 9 insertions, 9 deletions
diff --git a/threadproc/beos/proc.c b/threadproc/beos/proc.c index 3092f4502..e3698082f 100644 --- a/threadproc/beos/proc.c +++ b/threadproc/beos/proc.c @@ -362,8 +362,9 @@ APR_DECLARE(apr_status_t) apr_procattr_child_in_set(apr_procattr_t *attr, apr_fi == APR_SUCCESS) rv = apr_file_inherit_set(attr->child_in); } + } - if (parent_in != NULL && rv == APR_SUCCESS) { + if (parent_in != NULL && rv == APR_SUCCESS) rv = apr_file_dup(&attr->parent_in, parent_in, attr->pool); return rv; @@ -391,7 +392,7 @@ APR_DECLARE(apr_status_t) apr_procattr_child_out_set(apr_procattr_t *attr, apr_f } } - if (parent_out != NULL && rv == APR_SUCCESS) { + if (parent_out != NULL && rv == APR_SUCCESS) rv = apr_file_dup(&attr->parent_out, parent_out, attr->pool); return rv; @@ -419,7 +420,7 @@ APR_DECLARE(apr_status_t) apr_procattr_child_err_set(apr_procattr_t *attr, apr_f } } - if (parent_err != NULL && rv == APR_SUCCESS) { + if (parent_err != NULL && rv == APR_SUCCESS) rv = apr_file_dup(&attr->parent_err, parent_err, attr->pool); return rv; diff --git a/threadproc/unix/proc.c b/threadproc/unix/proc.c index b9a674b7f..8deb6de2f 100644 --- a/threadproc/unix/proc.c +++ b/threadproc/unix/proc.c @@ -396,7 +396,6 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, return errno; } else if (new->pid == 0) { - int status; /* child process */ /* @@ -478,7 +477,7 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, } /* Only try to switch if we are running as root */ if (attr->gid != -1 && !geteuid()) { - if ((status = setgid(attr->gid))) { + if (setgid(attr->gid)) { if (attr->errfn) { attr->errfn(pool, errno, "setting of group failed"); } @@ -487,7 +486,7 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, } if (attr->uid != -1 && !geteuid()) { - if ((status = setuid(attr->uid))) { + if (setuid(attr->uid)) { if (attr->errfn) { attr->errfn(pool, errno, "setting of user failed"); } @@ -495,7 +494,7 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *new, } } - if ((status = limit_proc(attr)) != APR_SUCCESS) { + if (limit_proc(attr) != APR_SUCCESS) { if (attr->errfn) { attr->errfn(pool, errno, "setting of resource limits failed"); } diff --git a/threadproc/unix/procsup.c b/threadproc/unix/procsup.c index 376baf21f..94177f92a 100644 --- a/threadproc/unix/procsup.c +++ b/threadproc/unix/procsup.c @@ -18,8 +18,6 @@ APR_DECLARE(apr_status_t) apr_proc_detach(int daemonize) { - int x; - if (chdir("/") == -1) { return errno; } @@ -28,6 +26,8 @@ APR_DECLARE(apr_status_t) apr_proc_detach(int daemonize) /* Don't detach for MPE because child processes can't survive the death of * the parent. */ if (daemonize) { + int x; + if ((x = fork()) > 0) { exit(0); } |