You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by rb...@hyperreal.org on 1999/12/13 15:01:36 UTC

cvs commit: apache-2.0/src/modules/mpm/mpmt_pthread mpmt_pthread.c

rbb         99/12/13 06:01:36

  Modified:    src/main http_log.c
               src/modules/mpm/mpmt_pthread mpmt_pthread.c
  Log:
  Get rid of a couple more ap_os_file_t's along with their platform
  dependant code.
  
  Revision  Changes    Path
  1.21      +9 -14     apache-2.0/src/main/http_log.c
  
  Index: http_log.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/main/http_log.c,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- http_log.c	1999/12/02 18:36:31	1.20
  +++ http_log.c	1999/12/13 14:01:34	1.21
  @@ -265,7 +265,7 @@
   {
       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 @@
       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 @@
   }
   
   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 @@
       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 @@
   	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) {
   	/*
  
  
  
  1.52      +0 -1      apache-2.0/src/modules/mpm/mpmt_pthread/mpmt_pthread.c
  
  Index: mpmt_pthread.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/modules/mpm/mpmt_pthread/mpmt_pthread.c,v
  retrieving revision 1.51
  retrieving revision 1.52
  diff -u -r1.51 -r1.52
  --- mpmt_pthread.c	1999/12/03 22:11:22	1.51
  +++ mpmt_pthread.c	1999/12/13 14:01:35	1.52
  @@ -1502,7 +1502,6 @@
   	if (!one_process) {
   	    unixd_detach();
   	}
  -
   	my_pid = getpid();
       }