httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Randy Terbush <ra...@zyzzyva.com>
Subject reentrant problem in log_error
Date Mon, 09 Dec 1996 00:40:56 GMT

This is the only problem that I would consider show stopper. Does
anyone have any further comments on the patch I submitted below.
After kicking this around with Paul the other day, I concluded that
perhaps we need to suspend the signal mask while in this function.
Since my knowledge of signals is fresh from Stevens, could someone
comment on the following addition to the patch below?

Here is a current patch. This does not seem to break anything.
I'll need to give this to an affected site to see if it fixes
anything. Can someone here comment on the changes?


*** http_log.c.orig	Sun Dec  1 18:01:29 1996
--- http_log.c	Sun Dec  8 18:04:14 1996
***************
*** 131,137 ****
          dup2(fileno(s->error_log),STDERR_FILENO);
  }
  
! void log_pid(pool *p, char *pid_fname) {
      FILE *pid_file;
  
      if (!pid_fname) return;
--- 131,138 ----
          dup2(fileno(s->error_log),STDERR_FILENO);
  }
  
! void log_pid(pool *p, char *pid_fname)
! {
      FILE *pid_file;
  
      if (!pid_fname) return;
***************
*** 145,158 ****
      fclose(pid_file);
  }
  
! void log_error(char *err, server_rec *s) {
!     fprintf(s->error_log, "[%s] %s\n",get_time(),err);
!     fflush(s->error_log);
  }
  
! void
! log_unixerr(const char *routine, const char *file, const char *msg,
! 	    server_rec *s)
  {
      const char *p, *q;
  
--- 146,168 ----
      fclose(pid_file);
  }
  
! void log_error(char *err, server_rec *s)
! {
!     int len;
!     char buf[512];
!     sigset_t clrmask, oldmask;
!     
! 
!     sigemptyset(&clrmask);
!     sigprocmask(SIG_SETMASK, &clrmask, &oldmask);
! 
!     len = sprintf(buf, "[%s] %s\n", get_time(), err);
!     write(fileno(s->error_log), buf, len + 1);
! 
!     sigprocmask(SIG_SETMASK, &oldmask, NULL);
  }
  
! void log_unixerr(const char *routine, const char *file, const char *msg, server_rec *s)
  {
      const char *p, *q;
  



Mime
View raw message