summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Habets <habets@google.com>2019-11-12 14:04:36 +0000
committerThomas Habets <habets@google.com>2019-11-12 14:04:36 +0000
commit0e5a10f172f4bbda5c69d96f8262d5db7c9d9358 (patch)
tree930511b5965ca7eec49f569e0c82f0f826c40d51
parent708c2ad7d0e9b2ad04450ff2f928ee08cebd0804 (diff)
downloadarping-0e5a10f172f4bbda5c69d96f8262d5db7c9d9358.tar.gz
Check signal() return code
-rw-r--r--src/unix.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/unix.c b/src/unix.c
index cac2202..abab9ca 100644
--- a/src/unix.c
+++ b/src/unix.c
@@ -20,6 +20,7 @@
#include "config.h"
#endif
+#include <errno.h>
#include <signal.h>
#include <string.h>
@@ -104,7 +105,10 @@ arping_lookupdev_default(uint32_t srcip, uint32_t dstip, char *ebuf)
void
do_signal_init()
{
- signal(SIGINT, sigint);
+ if (SIG_ERR == signal(SIGINT, sigint)) {
+ fprintf(stderr, "arping: failed to set SIGINT handler: %s\n",
+ strerror(errno));
+ }
}
/* ---- Emacs Variables ----
* Local Variables: