You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by Randy Terbush <ra...@hyperreal.com> on 1996/12/10 02:12:02 UTC

cvs commit: apache/src CHANGES http_main.c

randy       96/12/09 17:12:01

  Modified:    src       CHANGES http_main.c
  Log:
  Change set_signals() to use sigaction() for setup of signal handlers.
  sigaction() has the proper effect of blocking the signal until the
  return from the handler.
  Reviewed by: Ben Laurie, Paul Richards
  
  Revision  Changes    Path
  1.81      +7 -3      apache/src/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /export/home/cvs/apache/src/CHANGES,v
  retrieving revision 1.80
  retrieving revision 1.81
  diff -C3 -r1.80 -r1.81
  *** CHANGES	1996/12/10 01:04:05	1.80
  --- CHANGES	1996/12/10 01:11:57	1.81
  ***************
  *** 1,6 ****
    Changes with Apache 1.2b2:
    
  !   *) Changes to allow mod_status compile for OS/2
    
      *) changes for DEC AXP running OSF/1 v3.0. [Marc Evans]
    
  --- 1,10 ----
    Changes with Apache 1.2b2:
  +   
  +   *) Update set_signals() to use sigaction() for setting handlers.
  +      This appears to fix a re-entrant problem in the seg_fault()
  +      bus_error() handlers. [Randy Terbush]
    
  !   *) Changes to allow mod_status compile for OS/2 [Garey Smiley]
    
      *) changes for DEC AXP running OSF/1 v3.0. [Marc Evans]
    
  ***************
  *** 28,40 ****
      *) Closed file-globbing hole in test-cgi script. [Brian Behlendorf]
    
      *) Fixed problem in set_[user|group] that prevented CGI execution
  !      for non-virtualhosts when suEXEC was enabled.
    
      *) Added PORTING information file.  [Jim Jagielski]
    
      *) Added definitions for S_IWGRP and S_IWOTH to conf.h [Ben Laurie]
    
  !   *) Changed default group to "nogroup" instead of "nobody"
    
      *) Fixed define typo of FCNTL_SERIALIZED_ACCEPT where
         USE_FCNTL_SERIALIZED_ACCEPT was intended.
  --- 32,44 ----
      *) Closed file-globbing hole in test-cgi script. [Brian Behlendorf]
    
      *) Fixed problem in set_[user|group] that prevented CGI execution
  !      for non-virtualhosts when suEXEC was enabled. [Randy Terbush]
    
      *) Added PORTING information file.  [Jim Jagielski]
    
      *) Added definitions for S_IWGRP and S_IWOTH to conf.h [Ben Laurie]
    
  !   *) Changed default group to "nogroup" instead of "nobody" [Randy Terbush]
    
      *) Fixed define typo of FCNTL_SERIALIZED_ACCEPT where
         USE_FCNTL_SERIALIZED_ACCEPT was intended.
  
  
  
  1.95      +20 -12    apache/src/http_main.c
  
  Index: http_main.c
  ===================================================================
  RCS file: /export/home/cvs/apache/src/http_main.c,v
  retrieving revision 1.94
  retrieving revision 1.95
  diff -C3 -r1.94 -r1.95
  *** http_main.c	1996/12/05 21:39:42	1.94
  --- http_main.c	1996/12/10 01:11:58	1.95
  ***************
  *** 1083,1089 ****
        exit(1);
    }
    
  ! void bus_error() {
        log_error("httpd: caught SIGBUS, dumping core", server_conf);
        chdir(server_root);
        abort();         
  --- 1083,1089 ----
        exit(1);
    }
    
  ! void bus_error(void) {
        log_error("httpd: caught SIGBUS, dumping core", server_conf);
        chdir(server_root);
        abort();         
  ***************
  *** 1198,1219 ****
    #endif
        }
    
  ! void set_signals() {
    #ifndef NO_USE_SIGACTION
        struct sigaction sa;
  - #endif
  -     if(!one_process) {
  - 	signal(SIGSEGV,(void (*)())seg_fault);
  -     	signal(SIGBUS,(void (*)())bus_error);
  - 	}
    
  ! #ifdef NO_USE_SIGACTION
  !     signal(SIGTERM,(void (*)())sig_term);
  !     signal(SIGHUP,(void (*)())restart);
  !     signal(SIGUSR1,(void (*)())graceful_restart);
        /* USE WITH EXTREME CAUTION. Graceful restarts are known to break */
        /*  problems will be dealt with in a future release */
  - #else
        memset(&sa,0,sizeof sa);
        sa.sa_handler=(void (*)())sig_term;
        if(sigaction(SIGTERM,&sa,NULL) < 0)
  --- 1198,1218 ----
    #endif
        }
    
  ! void set_signals()
  ! {
    #ifndef NO_USE_SIGACTION
        struct sigaction sa;
    
  !     if (!one_process) {
  ! 	sa.sa_handler = (void (*)())seg_fault;
  ! 	if (sigaction(SIGSEGV, &sa, NULL) < 0)
  ! 	    log_unixerr("sigaction(SIGSEGV)", NULL, NULL, server_conf);
  ! 	sa.sa_handler = (void (*)())bus_error;
  ! 	if (sigaction(SIGBUS, &sa, NULL) < 0)
  ! 	    log_unixerr("sigaction(SIGBUS)", NULL, NULL, server_conf);
  !     }
        /* USE WITH EXTREME CAUTION. Graceful restarts are known to break */
        /*  problems will be dealt with in a future release */
        memset(&sa,0,sizeof sa);
        sa.sa_handler=(void (*)())sig_term;
        if(sigaction(SIGTERM,&sa,NULL) < 0)
  ***************
  *** 1224,1229 ****
  --- 1223,1237 ----
        sa.sa_handler=(void (*)())graceful_restart;
        if(sigaction(SIGUSR1,&sa,NULL) < 0)
    	log_unixerr("sigaction(SIGUSR1)", NULL, NULL, server_conf);
  + #else
  +     if(!one_process) {
  + 	signal(SIGSEGV,(void (*)())seg_fault);
  +     	signal(SIGBUS,(void (*)())bus_error);
  +     }
  + 
  +     signal(SIGTERM,(void (*)())sig_term);
  +     signal(SIGHUP,(void (*)())restart);
  +     signal(SIGUSR1,(void (*)())graceful_restart);
    #endif
    }