]> granicus.if.org Git - apache/commitdiff
Get rid of a couple more ap_os_file_t's along with their platform
authorRyan Bloom <rbb@apache.org>
Mon, 13 Dec 1999 14:01:35 +0000 (14:01 +0000)
committerRyan Bloom <rbb@apache.org>
Mon, 13 Dec 1999 14:01:35 +0000 (14:01 +0000)
dependant code.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@84283 13f79535-47bb-0310-9956-ffa450edef68

server/log.c
server/mpm/mpmt_pthread/mpmt_pthread.c

index 29ddff4f7c130ccda2df19eedcb905769440b300..7bb695ac826983971c3f5a1b34d39e4e86c2e9f3 100644 (file)
@@ -265,7 +265,7 @@ void ap_open_logs(server_rec *s_main, ap_context_t *p)
 {
     server_rec *virt, *q;
     int replace_stderr;
-    ap_os_file_t errfile;
+    ap_file_t *errfile = NULL;
 
     open_error_log(s_main, p);
 
@@ -273,8 +273,8 @@ void ap_open_logs(server_rec *s_main, ap_context_t *p)
     if (s_main->error_log) {
        /* replace stderr with this new log */
        fflush(stderr);
-        ap_get_os_file(&errfile, s_main->error_log);
-       if (dup2(errfile, STDERR_FILENO) == -1) {
+        ap_open_stderr(&errfile, p);        
+       if (ap_dupfile(&errfile, s_main->error_log) != APR_SUCCESS) {
            ap_log_error(APLOG_MARK, APLOG_CRIT, errno, s_main,
                "unable to replace stderr with error_log");
        } else {
@@ -307,12 +307,12 @@ void ap_open_logs(server_rec *s_main, ap_context_t *p)
 }
 
 API_EXPORT(void) ap_error_log2stderr(server_rec *s) {
-    ap_os_file_t errfile;
+    ap_file_t *errfile;
 
-    ap_get_os_file(&errfile, s->error_log);
-    if (   s->error_log != NULL
-        && errfile != STDERR_FILENO)
-        dup2(errfile, STDERR_FILENO);
+    ap_open_stderr(&errfile, s->process->pool);        
+    if (   s->error_log != NULL) {
+        ap_dupfile(&(s->error_log), errfile);
+    }
 }
 
 static void log_error_core(const char *file, int line, int level, 
@@ -322,7 +322,6 @@ static void log_error_core(const char *file, int line, int level,
     char errstr[MAX_STRING_LEN + 1];    /* + 1 to have room for '\n' */
     size_t len;
     ap_file_t *logf = NULL;
-    ap_os_file_t errfileno = STDERR_FILENO;
 
     if (s == NULL) {
        /*
@@ -333,11 +332,7 @@ static void log_error_core(const char *file, int line, int level,
        if (((level & APLOG_LEVELMASK) != APLOG_NOTICE) &&
            ((level & APLOG_LEVELMASK) > DEFAULT_LOGLEVEL))
            return;
-#ifdef WIN32
-        /* This is where the different ap_put_os_file's belong */
-#else
-       ap_put_os_file(&logf, &errfileno, NULL);
-#endif
+       ap_open_stderr(&logf, NULL);
     }
     else if (s->error_log) {
        /*
index 707bcfe70a63e8e64bfcdc4508a4419264169741..80ff2d25416399bd848261b5ae3ab8eb5b17f73b 100644 (file)
@@ -1502,7 +1502,6 @@ static void mpmt_pthread_pre_config(ap_context_t *pconf, ap_context_t *plog, ap_
        if (!one_process) {
            unixd_detach();
        }
-
        my_pid = getpid();
     }