projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
treewide: Use AF_UNSPEC consistently
[collectd.git]
/
src
/
daemon
/
common.c
diff --git
a/src/daemon/common.c
b/src/daemon/common.c
index
4c271d3
..
7bbace7
100644
(file)
--- a/
src/daemon/common.c
+++ b/
src/daemon/common.c
@@
-36,8
+36,6
@@
#include "plugin.h"
#include "utils_cache.h"
#include "plugin.h"
#include "utils_cache.h"
-#include <pthread.h>
-
#ifdef HAVE_MATH_H
# include <math.h>
#endif
#ifdef HAVE_MATH_H
# include <math.h>
#endif
@@
-1520,16
+1518,15
@@
int service_name_to_port_number (const char *service_name)
{
struct addrinfo *ai_list;
struct addrinfo *ai_ptr;
{
struct addrinfo *ai_list;
struct addrinfo *ai_ptr;
- struct addrinfo ai_hints;
int status;
int service_number;
if (service_name == NULL)
return (-1);
int status;
int service_number;
if (service_name == NULL)
return (-1);
- ai_list = NULL;
- memset (&ai_hints, 0, sizeof (ai_hints));
-
ai_hints.ai_family = AF_UNSPEC
;
+ struct addrinfo ai_hints = {
+ .ai_family = AF_UNSPEC
+
}
;
status = getaddrinfo (/* node = */ NULL, service_name,
&ai_hints, &ai_list);
status = getaddrinfo (/* node = */ NULL, service_name,
&ai_hints, &ai_list);