From: Ed Maste Date: Tue, 26 Jun 2012 14:43:54 +0000 (+0000) Subject: lib: Do not assume sig_atomic_t is int. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bf82917b26a3fb561f60e6709c79c39a2c5648fa;p=openvswitch lib: Do not assume sig_atomic_t is int. 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 Signed-off-by: Ben Pfaff --- diff --git a/AUTHORS b/AUTHORS index c03b5967..bdfcb33a 100644 --- 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 diff --git a/lib/fatal-signal.c b/lib/fatal-signal.c index fff2a730..9130a230 100644 --- a/lib/fatal-signal.c +++ b/lib/fatal-signal.c @@ -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