projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
treewide: use designated initializers for ai_hints
[collectd.git]
/
src
/
chrony.c
diff --git
a/src/chrony.c
b/src/chrony.c
index
4a09753
..
9c40dd3
100644
(file)
--- a/
src/chrony.c
+++ b/
src/chrony.c
@@
-306,14
+306,15
@@
static int
connect_client(const char *p_hostname,
const char *p_service, int p_family, int p_socktype)
{
connect_client(const char *p_hostname,
const char *p_service, int p_family, int p_socktype)
{
- struct addrinfo hints = { 0 };
- struct addrinfo *res = NULL, *ressave = NULL;
+ struct addrinfo *res, *ressave;
int n, sockfd;
int n, sockfd;
- hints.ai_family = p_family;
- hints.ai_socktype = p_socktype;
+ struct addrinfo ai_hints = {
+ .ai_family = p_family,
+ .ai_socktype = p_socktype
+ };
- n = getaddrinfo(p_hostname, p_service, &hints, &res);
+ n = getaddrinfo(p_hostname, p_service, &
ai_
hints, &res);
if (n < 0)
{
if (n < 0)
{