From: Ryan Bloom Date: Mon, 13 Dec 1999 14:01:35 +0000 (+0000) Subject: Get rid of a couple more ap_os_file_t's along with their platform X-Git-Tag: 1.3.10~99 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f8be925ab29643d8d5541a44fa926d8e80178aed;p=apache Get rid of a couple more ap_os_file_t's along with their platform dependant code. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@84283 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/server/log.c b/server/log.c index 29ddff4f7c..7bb695ac82 100644 --- a/server/log.c +++ b/server/log.c @@ -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) { /* diff --git a/server/mpm/mpmt_pthread/mpmt_pthread.c b/server/mpm/mpmt_pthread/mpmt_pthread.c index 707bcfe70a..80ff2d2541 100644 --- a/server/mpm/mpmt_pthread/mpmt_pthread.c +++ b/server/mpm/mpmt_pthread/mpmt_pthread.c @@ -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(); }