diff options
author | Guy Harris <guy@alum.mit.edu> | 2019-04-04 12:30:46 -0700 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2019-04-04 19:31:19 +0000 |
commit | 3b476156d41d84f8befc45d46e48c2fbee6a157d (patch) | |
tree | 97abf16f833535b08b568ab635c3e8d13fca42ea /epan/addr_resolv.c | |
parent | 436278747e736fd0158cb22ca1eff3f1c0055134 (diff) |
Don't print a message if a select() was interrupted by a signal.
That's just noise, especially if the signal is SIGINT.
Change-Id: I97df2396d60280e5978f637ec3bb8f93966674b8
Reviewed-on: https://code.wireshark.org/review/32718
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'epan/addr_resolv.c')
-rw-r--r-- | epan/addr_resolv.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/epan/addr_resolv.c b/epan/addr_resolv.c index ccf201f737..bbb8bdf03b 100644 --- a/epan/addr_resolv.c +++ b/epan/addr_resolv.c @@ -432,7 +432,9 @@ wait_for_sync_resolv(gboolean *completed) { nfds = ares_fds(ghba_chan, &rfds, &wfds); if (nfds > 0) { if (select(nfds, &rfds, &wfds, NULL, &tv) == -1) { /* call to select() failed */ - fprintf(stderr, "Warning: call to select() failed, error is %s\n", g_strerror(errno)); + /* If it's interrupted by a signal, no need to put out a message */ + if (errno != EINTR) + fprintf(stderr, "Warning: call to select() failed, error is %s\n", g_strerror(errno)); return; } ares_process(ghba_chan, &rfds, &wfds); @@ -2776,7 +2778,9 @@ host_name_lookup_process(void) { nfds = ares_fds(ghba_chan, &rfds, &wfds); if (nfds > 0) { if (select(nfds, &rfds, &wfds, NULL, &tv) == -1) { /* call to select() failed */ - fprintf(stderr, "Warning: call to select() failed, error is %s\n", g_strerror(errno)); + /* If it's interrupted by a signal, no need to put out a message */ + if (errno != EINTR) + fprintf(stderr, "Warning: call to select() failed, error is %s\n", g_strerror(errno)); return nro; } ares_process(ghba_chan, &rfds, &wfds); @@ -3387,7 +3391,9 @@ get_host_ipaddr(const char *host, guint32 *addrp) if (nfds > 0) { tvp = ares_timeout(ghbn_chan, &tv, &tv); if (select(nfds, &rfds, &wfds, NULL, tvp) == -1) { /* call to select() failed */ - fprintf(stderr, "Warning: call to select() failed, error is %s\n", g_strerror(errno)); + /* If it's interrupted by a signal, no need to put out a message */ + if (errno != EINTR) + fprintf(stderr, "Warning: call to select() failed, error is %s\n", g_strerror(errno)); return FALSE; } ares_process(ghbn_chan, &rfds, &wfds); @@ -3452,7 +3458,9 @@ get_host_ipaddr6(const char *host, ws_in6_addr *addrp) if (nfds > 0) { tvp = ares_timeout(ghbn_chan, &tv, &tv); if (select(nfds, &rfds, &wfds, NULL, tvp) == -1) { /* call to select() failed */ - fprintf(stderr, "Warning: call to select() failed, error is %s\n", g_strerror(errno)); + /* If it's interrupted by a signal, no need to put out a message */ + if (errno != EINTR) + fprintf(stderr, "Warning: call to select() failed, error is %s\n", g_strerror(errno)); return FALSE; } ares_process(ghbn_chan, &rfds, &wfds); |