projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Treewide: cleanup whitespace
[collectd.git]
/
src
/
ping.c
diff --git
a/src/ping.c
b/src/ping.c
index
8542164
..
88661e9
100644
(file)
--- a/
src/ping.c
+++ b/
src/ping.c
@@
-244,7
+244,7
@@
static int ping_dispatch_all (pingobj_t *pingobj) /* {{{ */
static void *ping_thread (void *arg) /* {{{ */
{
static void *ping_thread (void *arg) /* {{{ */
{
-
static
pingobj_t *pingobj = NULL;
+ pingobj_t *pingobj = NULL;
struct timeval tv_begin;
struct timeval tv_end;
struct timeval tv_begin;
struct timeval tv_end;
@@
-399,7
+399,7
@@
static int start_thread (void) /* {{{ */
pthread_mutex_unlock (&ping_lock);
return (-1);
}
pthread_mutex_unlock (&ping_lock);
return (-1);
}
-
+
pthread_mutex_unlock (&ping_lock);
return (0);
} /* }}} int start_thread */
pthread_mutex_unlock (&ping_lock);
return (0);
} /* }}} int start_thread */
@@
-427,8
+427,10
@@
static int stop_thread (void) /* {{{ */
status = -1;
}
status = -1;
}
+ pthread_mutex_lock (&ping_lock);
memset (&ping_thread_id, 0, sizeof (ping_thread_id));
ping_thread_error = 0;
memset (&ping_thread_id, 0, sizeof (ping_thread_id));
ping_thread_error = 0;
+ pthread_mutex_unlock (&ping_lock);
return (status);
} /* }}} int stop_thread */
return (status);
} /* }}} int stop_thread */
@@
-481,7
+483,7
@@
static int ping_config (const char *key, const char *value) /* {{{ */
hostlist_t *hl;
char *host;
hostlist_t *hl;
char *host;
- hl =
(hostlist_t *) malloc (sizeof (hostlist_t
));
+ hl =
malloc (sizeof (*hl
));
if (hl == NULL)
{
char errbuf[1024];
if (hl == NULL)
{
char errbuf[1024];