]> git.proxmox.com Git - mirror_frr.git/blobdiff - lib/sigevent.c
zebra, lib: fix the ZEBRA_INTERFACE_VRF_UPDATE zapi message
[mirror_frr.git] / lib / sigevent.c
index 2eebb47d6cdd439c4f5e688175d2316be3a19336..57b41503e1c142d5c4c6b7b8f18da96c80ae8225 100644 (file)
@@ -22,6 +22,7 @@
 #include <sigevent.h>
 #include <log.h>
 #include <memory.h>
+#include <lib_errors.h>
 
 #ifdef SA_SIGINFO
 #ifdef HAVE_UCONTEXT_H
@@ -83,7 +84,8 @@ int quagga_sigevent_process(void)
        sigdelset(&newmask, SIGKILL);
 
        if ((sigprocmask(SIG_BLOCK, &newmask, &oldmask)) < 0) {
-               zlog_err("quagga_signal_timer: couldnt block signals!");
+               flog_err_sys(EC_LIB_SYSTEM_CALL,
+                            "quagga_signal_timer: couldnt block signals!");
                return -1;
        }
 #endif /* SIGEVENT_BLOCK_SIGNALS */
@@ -119,8 +121,6 @@ int quagga_sigevent_process(void)
 int quagga_signal_timer(struct thread *t)
 {
        struct quagga_sigevent_master_t *sigm;
-       struct quagga_signal_t *sig;
-       int i;
 
        sigm = THREAD_ARG(t);
        sigm->t = NULL;
@@ -207,14 +207,14 @@ exit_handler(int signo
             ,
             siginfo_t *siginfo, void *context
 #endif
-)
+            )
 {
        zlog_signal(signo, "exiting..."
 #ifdef SA_SIGINFO
                    ,
                    siginfo, program_counter(context)
 #endif
-       );
+                           );
        _exit(128 + signo);
 }
 
@@ -224,7 +224,7 @@ core_handler(int signo
             ,
             siginfo_t *siginfo, void *context
 #endif
-)
+            )
 {
        /* make sure we don't hang in here.  default for SIGALRM is terminate.
         * - if we're in backtrace for more than a second, abort. */
@@ -243,9 +243,9 @@ core_handler(int signo
                    ,
                    siginfo, program_counter(context)
 #endif
-       );
+                           );
        /* dump memory stats on core */
-       log_memstats_stderr("core_handler");
+       log_memstats(stderr, "core_handler");
        abort();
 }
 
@@ -284,22 +284,22 @@ static void trap_default_signals(void)
        };
        static const struct {
                const int *sigs;
-               u_int nsigs;
+               unsigned int nsigs;
                void (*handler)(int signo
 #ifdef SA_SIGINFO
                                ,
                                siginfo_t *info, void *context
 #endif
-               );
+                               );
        } sigmap[] = {
                {core_signals, array_size(core_signals), core_handler},
                {exit_signals, array_size(exit_signals), exit_handler},
                {ignore_signals, array_size(ignore_signals), NULL},
        };
-       u_int i;
+       unsigned int i;
 
        for (i = 0; i < array_size(sigmap); i++) {
-               u_int j;
+               unsigned int j;
 
                for (j = 0; j < sigmap[i].nsigs; j++) {
                        struct sigaction oact;
@@ -329,7 +329,8 @@ static void trap_default_signals(void)
                                }
                                if (sigaction(sigmap[i].sigs[j], &act, NULL)
                                    < 0)
-                                       zlog_warn(
+                                       flog_err(
+                                               EC_LIB_SYSTEM_CALL,
                                                "Unable to set signal handler for signal %d: %s",
                                                sigmap[i].sigs[j],
                                                safe_strerror(errno));