projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
mqtt, gps: add name parameter to plugin_thread_create()
[collectd.git]
/
src
/
dns.c
diff --git
a/src/dns.c
b/src/dns.c
index
04e5a1e
..
4a5c0fa
100644
(file)
--- a/
src/dns.c
+++ b/
src/dns.c
@@
-278,30
+278,16
@@
static int dns_run_pcap_loop (void)
static int dns_sleep_one_interval (void) /* {{{ */
{
static int dns_sleep_one_interval (void) /* {{{ */
{
- cdtime_t interval;
- struct timespec ts = { 0, 0 };
- int status = 0;
-
- interval = plugin_get_interval ();
- CDTIME_T_TO_TIMESPEC (interval, &ts);
-
- while (42)
+ struct timespec ts = CDTIME_T_TO_TIMESPEC (plugin_get_interval ());
+ while (nanosleep (&ts, &ts) != 0)
{
{
- struct timespec rem = { 0, 0 };
-
- status = nanosleep (&ts, &rem);
- if (status == 0)
- break;
- else if ((errno == EINTR) || (errno == EAGAIN))
- {
- ts = rem;
+ if ((errno == EINTR) || (errno == EAGAIN))
continue;
continue;
- }
- else
- break;
+
+ return (errno);
}
}
- return (
status
);
+ return (
0
);
} /* }}} int dns_sleep_one_interval */
static void *dns_child_loop (__attribute__((unused)) void *dummy) /* {{{ */
} /* }}} int dns_sleep_one_interval */
static void *dns_child_loop (__attribute__((unused)) void *dummy) /* {{{ */
@@
-339,7
+325,7
@@
static int dns_init (void)
return (-1);
status = plugin_thread_create (&listen_thread, NULL, dns_child_loop,
return (-1);
status = plugin_thread_create (&listen_thread, NULL, dns_child_loop,
- (void *) 0);
+ (void *) 0
, "dns listen"
);
if (status != 0)
{
char errbuf[1024];
if (status != 0)
{
char errbuf[1024];