summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: eae3f57)
raw | patch | inline | side by side (parent: eae3f57)
author | Florian Forster <octo@collectd.org> | |
Sat, 6 Aug 2016 16:22:56 +0000 (18:22 +0200) | ||
committer | Florian Forster <octo@collectd.org> | |
Sat, 6 Aug 2016 16:22:56 +0000 (18:22 +0200) |
Signaling an error caused the init function to signal an error, causing
the read callback to be unregistered on systems where init is called
more than once.
Fixes: #869
the read callback to be unregistered on systems where init is called
more than once.
Fixes: #869
src/ping.c | patch | blob | history |
diff --git a/src/ping.c b/src/ping.c
index ecbbd9d0f32960b0174f350fe003fe68a8e5ce51..fca730f5e7698bb56e169b8559c036f81e424c3e 100644 (file)
--- a/src/ping.c
+++ b/src/ping.c
if (ping_thread_loop != 0)
{
pthread_mutex_unlock (&ping_lock);
- return (-1);
+ return (0);
}
ping_thread_loop = 1;
pthread_mutex_unlock (&ping_lock);
return (-1);
}
-
+
pthread_mutex_unlock (&ping_lock);
return (0);
} /* }}} int start_thread */
"Will use a timeout of %gs.", ping_timeout);
}
- if (start_thread () != 0)
- return (-1);
-
- return (0);
+ return (start_thread ());
} /* }}} int ping_init */
static int config_set_string (const char *name, /* {{{ */