aboutsummaryrefslogtreecommitdiff
path: root/threadproc/unix/procsup.c
diff options
context:
space:
mode:
Diffstat (limited to 'threadproc/unix/procsup.c')
-rw-r--r--threadproc/unix/procsup.c4
1 files changed, 2 insertions, 2 deletions
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);
}