Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nginx/nginx.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2003-06-15 22:32:13 +0400
committerIgor Sysoev <igor@sysoev.ru>2003-06-15 22:32:13 +0400
commitbe2cfc3d28c90b0e911f22d6f14ce927b7f5bfad (patch)
tree52bcfd54a3779fd021278e28dffad5d5bd2f2f4a /src/os/unix/ngx_daemon.c
parent0915977df53c486abbc6081e1c83f9f8e7a8f111 (diff)
nginx-0.0.1-2003-06-15-22:32:13 import
Diffstat (limited to 'src/os/unix/ngx_daemon.c')
-rw-r--r--src/os/unix/ngx_daemon.c24
1 files changed, 2 insertions, 22 deletions
diff --git a/src/os/unix/ngx_daemon.c b/src/os/unix/ngx_daemon.c
index 93d3571b0..7d05fef9b 100644
--- a/src/os/unix/ngx_daemon.c
+++ b/src/os/unix/ngx_daemon.c
@@ -1,9 +1,7 @@
#include <ngx_config.h>
#include <ngx_core.h>
-#include <ngx_log.h>
-/* daemon in Linux */
int ngx_daemon(ngx_log_t *log)
{
@@ -26,27 +24,8 @@ int ngx_daemon(ngx_log_t *log)
return NGX_ERROR;
}
-#if (__SVR4 || linux)
-
- /* need HUP IGN ? check in Solaris and Linux */
-
- switch (fork()) {
- case -1:
- ngx_log_error(NGX_LOG_EMERG, log, errno, "fork() failed");
- return NGX_ERROR;
-
- case 0:
- break;
-
- default:
- exit(0);
- }
-
-#endif
-
umask(0);
-#if 0
fd = open("/dev/null", O_RDWR);
if (fd == -1) {
ngx_log_error(NGX_LOG_EMERG, log, errno, "open(\"/dev/null\") failed");
@@ -63,10 +42,12 @@ int ngx_daemon(ngx_log_t *log)
return NGX_ERROR;
}
+#if 0
if (dup2(fd, STDERR_FILENO) == -1) {
ngx_log_error(NGX_LOG_EMERG, log, errno, "dup2(STDERR) failed");
return NGX_ERROR;
}
+#endif
if (fd > STDERR_FILENO) {
if (close(fd) == -1) {
@@ -74,7 +55,6 @@ int ngx_daemon(ngx_log_t *log)
return NGX_ERROR;
}
}
-#endif
return NGX_OK;
}