lib: Do not assume sig_atomic_t is int.
authorEd Maste <emaste@freebsd.org>
Tue, 26 Jun 2012 14:43:54 +0000 (14:43 +0000)
committerBen Pfaff <blp@nicira.com>
Tue, 26 Jun 2012 16:31:05 +0000 (09:31 -0700)
On FreeBSD sig_atomic_t is long, which causes the comparison in
fatal_signal_run to be true when no signal has been reported.

Signed-off-by: Ed Maste <emaste@freebsd.org>
Signed-off-by: Ben Pfaff <blp@nicira.com>
AUTHORS
lib/fatal-signal.c

diff --git a/AUTHORS b/AUTHORS
index c03b5967c1a4b9b210631f559a9a8b1ebf3fad29..bdfcb33ad4ae05a2c9ad7b29325b3b7d0f8cb34d 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -22,6 +22,7 @@ David Erickson          derickso@stanford.edu
 David S. Miller         davem@davemloft.net
 Devendra Naga           devendra.aaru@gmail.com
 Dominic Curran          dominic.curran@citrix.com
+Ed Maste                emaste at freebsd.org
 Edward Tomasz NapieraƂa trasz@freebsd.org
 Ethan Jackson           ethan@nicira.com
 Gaetano Catalli         gaetano.catalli@gmail.com
index fff2a73050021ab638751b0755c8b0df2fdf9e3d..9130a230084b07d41ac3b8826f5bb26d5d895226 100644 (file)
@@ -152,14 +152,14 @@ fatal_signal_handler(int sig_nr)
 void
 fatal_signal_run(void)
 {
-    int sig_nr;
+    sig_atomic_t sig_nr;
 
     fatal_signal_init();
 
     sig_nr = stored_sig_nr;
     if (sig_nr != SIG_ATOMIC_MAX) {
         VLOG_WARN("terminating with signal %d (%s)",
-                  sig_nr, signal_name(sig_nr));
+                  (int)sig_nr, signal_name(sig_nr));
         call_hooks(sig_nr);
 
         /* Re-raise the signal with the default handling so that the program