dreid       99/10/22 04:28:34

  Modified:    src/modules/mpm/mpmt_beos mpmt_beos.c
  Log:
  Bring the BeOS mpm up to date with the error logging changes.
  
  Revision  Changes    Path
  1.4       +42 -37    apache-2.0/src/modules/mpm/mpmt_beos/mpmt_beos.c
  
  Index: mpmt_beos.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/modules/mpm/mpmt_beos/mpmt_beos.c,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- mpmt_beos.c       1999/10/13 22:37:19     1.3
  +++ mpmt_beos.c       1999/10/22 11:28:33     1.4
  @@ -344,14 +344,14 @@
            case 7:     /* 1.4sec */
                /* ok, now it's being annoying */
                ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_WARNING,
  -                         server_conf,
  +                         errno, server_conf,
                   "child process %d still did not exit, sending a SIGTERM",
                            pid);
                kill(pid, SIGTERM);
                break;
            case 8:     /*  6 sec */
                /* die child scum */
  -             ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, server_conf,
  +             ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, errno, 
server_conf,
                   "child process %d still did not exit, sending a SIGKILL",
                            pid);
                kill(pid, SIGKILL);
  @@ -362,7 +362,7 @@
                 * exited, we will likely fail to bind to the port
                 * after the restart.
                 */
  -             ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, server_conf,
  +             ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, errno, 
server_conf,
                            "could not make child process %d exit, "
                            "attempting to continue anyway", pid);
                break;
  @@ -526,33 +526,33 @@
        sa.sa_handler = sig_coredump;
   
        if (sigaction(SIGSEGV, &sa, NULL) < 0)
  -         ap_log_error(APLOG_MARK, APLOG_WARNING, server_conf, 
"sigaction(SIGSEGV)");
  +         ap_log_error(APLOG_MARK, APLOG_WARNING, errno, server_conf, 
"sigaction(SIGSEGV)");
        if (sigaction(SIGBUS, &sa, NULL) < 0)
  -         ap_log_error(APLOG_MARK, APLOG_WARNING, server_conf, 
"sigaction(SIGBUS)");
  +         ap_log_error(APLOG_MARK, APLOG_WARNING, errno, server_conf, 
"sigaction(SIGBUS)");
        if (sigaction(SIGABRT, &sa, NULL) < 0)
  -         ap_log_error(APLOG_MARK, APLOG_WARNING, server_conf, 
"sigaction(SIGABRT)");
  +         ap_log_error(APLOG_MARK, APLOG_WARNING, errno, server_conf, 
"sigaction(SIGABRT)");
        if (sigaction(SIGILL, &sa, NULL) < 0)
  -         ap_log_error(APLOG_MARK, APLOG_WARNING, server_conf, 
"sigaction(SIGILL)");
  +         ap_log_error(APLOG_MARK, APLOG_WARNING, errno, server_conf, 
"sigaction(SIGILL)");
        sa.sa_flags = 0;
       }
       sa.sa_handler = sig_term;
       if (sigaction(SIGTERM, &sa, NULL) < 0)
  -         ap_log_error(APLOG_MARK, APLOG_WARNING, server_conf, 
"sigaction(SIGTERM)");
  +         ap_log_error(APLOG_MARK, APLOG_WARNING, errno, server_conf, 
"sigaction(SIGTERM)");
       if (sigaction(SIGINT, &sa, NULL) < 0)
  -        ap_log_error(APLOG_MARK, APLOG_WARNING, server_conf, 
"sigaction(SIGINT)");
  +        ap_log_error(APLOG_MARK, APLOG_WARNING, errno, server_conf, 
"sigaction(SIGINT)");
       
       sa.sa_handler = SIG_IGN;
       if (sigaction(SIGPIPE, &sa, NULL) < 0)
  -     ap_log_error(APLOG_MARK, APLOG_WARNING, server_conf, 
"sigaction(SIGPIPE)");
  +     ap_log_error(APLOG_MARK, APLOG_WARNING, errno, server_conf, 
"sigaction(SIGPIPE)");
   
       /* we want to ignore HUPs and WINCH while we're busy processing one */
       sigaddset(&sa.sa_mask, SIGHUP);
       sigaddset(&sa.sa_mask, SIGWINCH);
       sa.sa_handler = restart;
       if (sigaction(SIGHUP, &sa, NULL) < 0)
  -     ap_log_error(APLOG_MARK, APLOG_WARNING, server_conf, 
"sigaction(SIGHUP)");
  +     ap_log_error(APLOG_MARK, APLOG_WARNING, errno, server_conf, 
"sigaction(SIGHUP)");
       if (sigaction(SIGWINCH, &sa, NULL) < 0)
  -         ap_log_error(APLOG_MARK, APLOG_WARNING, server_conf, 
"sigaction(SIGWINCH)");
  +         ap_log_error(APLOG_MARK, APLOG_WARNING, errno, server_conf, 
"sigaction(SIGWINCH)");
   }
   
   static void process_child_status(int pid, ap_wait_t status)
  @@ -562,7 +562,7 @@
        */
       if ((WIFEXITED(status)) &&
        WEXITSTATUS(status) == APEXIT_CHILDFATAL) {
  -     ap_log_error(APLOG_MARK, APLOG_ALERT|APLOG_NOERRNO, server_conf,
  +     ap_log_error(APLOG_MARK, APLOG_ALERT|APLOG_NOERRNO, errno, server_conf,
                        "Child %d returned a Fatal error... \n"
                        "Apache is exiting!",
                        pid);
  @@ -580,7 +580,7 @@
   #ifdef WCOREDUMP
            if (WCOREDUMP(status)) {
                ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_NOTICE,
  -                          server_conf,
  +                          errno, server_conf,
                             "child pid %d exit signal %s (%d), "
                             "possible coredump in %s",
                             pid, (WTERMSIG(status) >= NumSIG) ? "" : 
  @@ -590,7 +590,7 @@
            else {
   #endif
                ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_NOTICE,
  -                          server_conf,
  +                          errno, server_conf,
                             "child pid %d exit signal %s (%d)", pid,
                             SYS_SIGLIST[WTERMSIG(status)], WTERMSIG(status));
   #ifdef WCOREDUMP
  @@ -598,7 +598,7 @@
   #endif
   #else
            ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_NOTICE,
  -                      server_conf,
  +                      errno, server_conf,
                         "child pid %d exit signal %d",
                         pid, WTERMSIG(status));
   #endif
  @@ -645,7 +645,7 @@
       long conn_id = my_child_num * HARD_THREAD_LIMIT + my_thread_num;
   
       if (getsockname(csd, &sa_server, &len) < 0) { 
  -     ap_log_error(APLOG_MARK, APLOG_ERR, server_conf, "getsockname");
  +     ap_log_error(APLOG_MARK, APLOG_ERR, errno, server_conf, "getsockname");
        closesocket(csd);
        return;
       }
  @@ -655,13 +655,13 @@
       iol = beos_attach_socket(csd);
       if (iol == NULL) {
           if (errno == EBADF) {
  -            ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_WARNING, NULL,
  +            ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_WARNING, errno, 
NULL,
                   "filedescriptor (%u) larger than FD_SETSIZE (%u) "
                   "found, you probably need to rebuild Apache with a "
                   "larger FD_SETSIZE", csd, FD_SETSIZE);
           }
           else {
  -            ap_log_error(APLOG_MARK, APLOG_WARNING, NULL,
  +            ap_log_error(APLOG_MARK, APLOG_WARNING, errno, NULL,
                   "error attaching to socket");
           }
           closesocket(csd);
  @@ -731,7 +731,7 @@
   
                   /* poll() will only return errors in catastrophic
                    * circumstances. Let's try exiting gracefully, for now. */
  -                ap_log_error(APLOG_MARK, APLOG_ERR, (const server_rec *)
  +                ap_log_error(APLOG_MARK, APLOG_ERR,errno,  (const server_rec 
*)
                                ap_get_server_conf(), "poll: (listen)");
                   workers_may_exit = 1;
               }
  @@ -845,7 +845,7 @@
   
        my_info = (proc_info *)malloc(sizeof(proc_info));
           if (my_info == NULL) {
  -            ap_log_error(APLOG_MARK, APLOG_ALERT, server_conf,
  +            ap_log_error(APLOG_MARK, APLOG_ALERT, errno, server_conf,
                         "malloc: out of memory");
               clean_child_exit(APEXIT_CHILDFATAL);
           }
  @@ -860,7 +860,7 @@
   
        if ((thread = spawn_thread(worker_thread, "httpd_worker_thread",
              B_NORMAL_PRIORITY, my_info)) < B_NO_ERROR) {
  -         ap_log_error(APLOG_MARK, APLOG_ALERT, server_conf,
  +         ap_log_error(APLOG_MARK, APLOG_ALERT, errno, server_conf,
                         "spawn_thread: unable to create worker thread");
               /* In case system resources are maxxed out, we don't want
                  Apache running away with the CPU trying to fork over and
  @@ -903,7 +903,8 @@
       tid = spawn_thread(child_main, "httpd_child", B_NORMAL_PRIORITY,
           (void*)slot);
       if (tid < B_NO_ERROR) {
  -        ap_log_error(APLOG_MARK, APLOG_ERR, s, "spawn_thread: Unable to fork 
new process");
  +        ap_log_error(APLOG_MARK, APLOG_ERR, errno, s, 
  +            "spawn_thread: Unable to fork new process");
        /* In case system resources are maxxed out, we don't want
           Apache running away with the CPU trying to fork over and
           over and over again. */
  @@ -1020,7 +1021,8 @@
           /* Kill off one child */
           char char_of_death = '!';
           if (write_port(port_of_death, 99, &char_of_death, 1) != B_OK) {
  -            ap_log_error(APLOG_MARK, APLOG_WARNING, server_conf, "write 
pipe_of_death");
  +            ap_log_error(APLOG_MARK, APLOG_WARNING, errno, server_conf,
  +                 "write pipe_of_death");
           }
           idle_spawn_rate = 1;
       }
  @@ -1031,7 +1033,7 @@
            static int reported = 0;
            
            if (!reported) {
  -             ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, server_conf,
  +             ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, errno, 
server_conf,
                             "server reached MaxClients setting, consider"
                             " raising the MaxClients setting");
                reported = 1;
  @@ -1042,7 +1044,7 @@
            /* ZZZZ */
            
            if (idle_spawn_rate >= 8) {
  -             ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_INFO, server_conf,
  +             ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_INFO, errno, 
server_conf,
                             "server seems busy, (you may need "
                             "to increase StartServers, ThreadsPerChild "
                                "or Min/MaxSparetThreads), "
  @@ -1107,7 +1109,7 @@
                    * scoreboard.  Somehow we don't know about this
                    * child.
                    */
  -             ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_WARNING, 
server_conf,
  +             ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_WARNING, errno, 
server_conf,
                            "long lost child came home! (pid %d)", pid);
            }
            /* Don't perform idle maintenance when a child dies,
  @@ -1145,7 +1147,7 @@
   
       if ((num_listenfds = setup_listeners(server_conf)) < 1) {
           /* XXX: hey, what's the right way for the mpm to indicate a fatal 
error? */
  -        ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ALERT, s,
  +        ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ALERT, errno, s,
               "no listening sockets available, shutting down");
           return 1;
       }
  @@ -1182,10 +1184,10 @@
        hold_off_on_exponential_spawning = 10;
       }
   
  -    ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_NOTICE, server_conf,
  +    ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_NOTICE, errno, server_conf,
                "%s configured -- resuming normal operations",
                ap_get_server_version());
  -    ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_INFO, server_conf,
  +    ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_INFO, errno, server_conf,
                "Server built: %s", ap_get_server_built());
       restart_pending = shutdown_pending = 0;
   
  @@ -1196,7 +1198,8 @@
            * Kill child processes, tell them to call child_exit, etc...
            */
           if (ap_killpg(getpgrp(), SIGTERM) < 0) {
  -            ap_log_error(APLOG_MARK, APLOG_WARNING, server_conf, "killpg 
SIGTERM");
  +            ap_log_error(APLOG_MARK, APLOG_WARNING, errno, server_conf,
  +             "killpg SIGTERM");
           }
           reclaim_child_processes(1);          /* Start with SIGTERM */
       
  @@ -1206,12 +1209,12 @@
               pidfile = ap_server_root_relative (pconf, ap_pid_fname);
               if ( pidfile != NULL && unlink(pidfile) == 0)
                   ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_INFO,
  -                      server_conf,
  +                      errno, server_conf,
                         "removed PID file %s (pid=%ld)",
                         pidfile, (long)getpid());
           }
       
  -        ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_NOTICE, server_conf,
  +        ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_NOTICE, errno, 
server_conf,
               "caught SIGTERM, shutting down");
       
        return 1;
  @@ -1237,14 +1240,15 @@
        int i, j;
           char char_of_death = '!';
   
  -     ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_NOTICE, server_conf,
  +     ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_NOTICE, errno, server_conf,
                    "SIGWINCH received.  Doing graceful restart");
   
        /* give the children the signal to die */
           for (i = 0; i < ap_daemons_limit;) {
               if (write_port(port_of_death, 99, &char_of_death, 1) != B_OK) {
                   if (errno == EINTR) continue;
  -                ap_log_error(APLOG_MARK, APLOG_WARNING, server_conf, "write 
pipe_of_death");
  +                ap_log_error(APLOG_MARK, APLOG_WARNING, errno, server_conf,
  +                   "write pipe_of_death");
               }
               i++;
           }
  @@ -1267,10 +1271,11 @@
          * pthreads are stealing signals from us left and right.
          */
        if (ap_killpg(getpgrp(), SIGTERM) < 0) {
  -         ap_log_error(APLOG_MARK, APLOG_WARNING, server_conf, "killpg 
SIGTERM");
  +         ap_log_error(APLOG_MARK, APLOG_WARNING, errno, server_conf,
  +            "killpg SIGTERM");
        }
           reclaim_child_processes(1);          /* Start with SIGTERM */
  -     ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_NOTICE, server_conf,
  +     ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_NOTICE, errno, server_conf,
                    "SIGHUP received.  Attempting to restart");
       }
       if (!is_graceful) {
  
  
  

Reply via email to