]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/lib/signal.c
Add debug times, reduce size of two-pool-changer test
[bacula/bacula] / bacula / src / lib / signal.c
index f5a624af82188f4f22b393b21bfc258b787339c4..7643bf643ded207525cf88b9fc1827d75c044f0b 100644 (file)
@@ -7,8 +7,8 @@
    many others, a complete list can be found in the file AUTHORS.
    This program is Free Software; you can redistribute it and/or
    modify it under the terms of version two of the GNU General Public
-   License as published by the Free Software Foundation plus additions
-   that are listed in the file LICENSE.
+   License as published by the Free Software Foundation and included
+   in the file LICENSE.
 
    This program is distributed in the hope that it will be useful, but
    WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -91,7 +91,7 @@ extern "C" void signal_handler(int sig)
    if (sig == SIGTERM) {
 //    Emsg1(M_TERM, -1, "Shutting down Bacula service: %s ...\n", my_name);
    } else {
-      Emsg2(M_FATAL, -1, _("Bacula interrupted by signal %d: %s\n"), sig, sig_names[sig]);
+      Emsg2(M_FATAL, -1, _("Bacula interrupted by signal %d: %s\n"), sig, get_signal_name(sig));
    }
 
 #ifdef TRACEBACK
@@ -104,8 +104,8 @@ extern "C" void signal_handler(int sig)
       pid_t pid;
       int exelen = strlen(exepath);
 
-      fprintf(stderr, _("Kaboom! %s, %s got signal %d. Attempting traceback.\n"),
-              exename, my_name, sig);
+      fprintf(stderr, _("Kaboom! %s, %s got signal %d - %s. Attempting traceback.\n"),
+              exename, my_name, sig, get_signal_name(sig));
       fprintf(stderr, _("Kaboom! exepath=%s\n"), exepath);
 
       if (exelen + 12 > (int)sizeof(btpath)) {
@@ -149,7 +149,8 @@ extern "C" void signal_handler(int sig)
          argv[3] = (char *)NULL;
          fprintf(stderr, _("Calling: %s %s %s\n"), btpath, exepath, pid_buf);
          if (execv(btpath, argv) != 0) {
-            printf(_("execv: %s failed: ERR=%s\n"), btpath, strerror(errno));
+            berrno be;
+            printf(_("execv: %s failed: ERR=%s\n"), btpath, be.bstrerror());
          }
          exit(-1);
       default:                        /* parent */
@@ -301,7 +302,7 @@ void init_signals(void terminate(int sig))
    sigaction(SIGEMT,    &sighandle, NULL);
 #endif
 #ifdef SIGIOT
-/* sigaction(SIGIOT,    &sighandle, NULL);  used by debugger */
+   sigaction(SIGIOT,    &sighandle, NULL);                     
 #endif
    sigaction(SIGBUS,    &sighandle, NULL);
    sigaction(SIGFPE,    &sighandle, NULL);