diff options
author | Thomas Habets <habets@google.com> | 2019-11-12 14:04:36 +0000 |
---|---|---|
committer | Thomas Habets <habets@google.com> | 2019-11-12 14:04:36 +0000 |
commit | 0e5a10f172f4bbda5c69d96f8262d5db7c9d9358 (patch) | |
tree | 930511b5965ca7eec49f569e0c82f0f826c40d51 | |
parent | 708c2ad7d0e9b2ad04450ff2f928ee08cebd0804 (diff) | |
download | arping-0e5a10f172f4bbda5c69d96f8262d5db7c9d9358.tar.gz |
Check signal() return code
-rw-r--r-- | src/unix.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -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: |