projects
/
collectd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
3fb6fe5
)
email plugin: initialize structure
author
Ruben Kerkhof
<ruben@rubenkerkhof.com>
Fri, 9 Dec 2016 16:20:43 +0000
(17:20 +0100)
committer
Ruben Kerkhof
<ruben@rubenkerkhof.com>
Fri, 9 Dec 2016 16:20:43 +0000
(17:20 +0100)
CID 38125
src/email.c
patch
|
blob
|
history
diff --git
a/src/email.c
b/src/email.c
index
b406d48
..
34e9998
100644
(file)
--- a/
src/email.c
+++ b/
src/email.c
@@
-361,8
+361,6
@@
static void *collect(void *arg) {
} /* static void *collect (void *) */
static void *open_connection(void __attribute__((unused)) * arg) {
} /* static void *collect (void *) */
static void *open_connection(void __attribute__((unused)) * arg) {
- struct sockaddr_un addr;
-
const char *path = (NULL == sock_file) ? SOCK_PATH : sock_file;
const char *group = (NULL == sock_group) ? COLLECTD_GRP_NAME : sock_group;
const char *path = (NULL == sock_file) ? SOCK_PATH : sock_file;
const char *group = (NULL == sock_group) ? COLLECTD_GRP_NAME : sock_group;
@@
-375,7
+373,9
@@
static void *open_connection(void __attribute__((unused)) * arg) {
pthread_exit((void *)1);
}
pthread_exit((void *)1);
}
- addr.sun_family = AF_UNIX;
+ struct sockaddr_un addr = {
+ .sun_family = AF_UNIX
+ };
sstrncpy(addr.sun_path, path, (size_t)(UNIX_PATH_MAX - 1));
errno = 0;
sstrncpy(addr.sun_path, path, (size_t)(UNIX_PATH_MAX - 1));
errno = 0;