summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: db71b0f)
raw | patch | inline | side by side (parent: db71b0f)
author | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Sun, 5 Nov 2006 12:05:50 +0000 (13:05 +0100) | ||
committer | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Sun, 5 Nov 2006 12:05:50 +0000 (13:05 +0100) |
src/dns.c | patch | blob | history |
diff --git a/src/dns.c b/src/dns.c
index a83f0ac16f0f3984d5d7143ee1fe9c8cbf558451..b97ce2870d58569a839b489e250cbb9201227f75 100644 (file)
--- a/src/dns.c
+++ b/src/dns.c
struct pollfd poll_fds[2];
int status;
+ /* Don't catch these signals */
+ signal (SIGINT, SIG_DFL);
+ signal (SIGTERM, SIG_DFL);
+
/* Passing `pcap_device == NULL' is okay and the same as passign "any" */
DBG ("Creating PCAP object..");
pcap_obj = pcap_open_live (pcap_device,
DBG ("poll (...)");
status = poll (poll_fds, 2, -1 /* wait forever for a change */);
+ /* Signals are not caught, but this is very handy when
+ * attaching to the process with a debugger. -octo */
+ if ((status < 0) && (errno == EINTR))
+ {
+ errno = 0;
+ continue;
+ }
+
if (status < 0)
{
syslog (LOG_ERR, "dns plugin: poll(2) failed: %s",