Skip to content

Commit 4c62b27

Browse files
ikegami-tigaw
authored andcommitted
util: Use HAVE_NETDB instead of HAVE_LIBNSS
Signed-off-by: Tokunori Ikegami <[email protected]>
1 parent 42ac453 commit 4c62b27

2 files changed

Lines changed: 5 additions & 7 deletions

File tree

meson.build

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ conf.set10(
216216
)
217217

218218
conf.set(
219-
'HAVE_LIBNSS',
219+
'HAVE_NETDB',
220220
cc.links(
221221
'''#include <sys/types.h>
222222
#include <sys/socket.h>
@@ -226,7 +226,7 @@ conf.set(
226226
return getaddrinfo(argv[1], argv[2], &hints, &result);
227227
}
228228
''',
229-
name: 'libnss',
229+
name: 'netdb',
230230
),
231231
description: 'Is network address and service translation available'
232232
)

src/nvme/util.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -579,7 +579,7 @@ const char *nvme_errno_to_string(int status)
579579
return s;
580580
}
581581

582-
#ifdef HAVE_LIBNSS
582+
#ifdef HAVE_NETDB
583583
char *hostname2traddr(struct nvme_root *r, const char *traddr)
584584
{
585585
struct addrinfo *host_info, hints = {.ai_family = AF_UNSPEC};
@@ -623,9 +623,7 @@ char *hostname2traddr(struct nvme_root *r, const char *traddr)
623623
freeaddrinfo(host_info);
624624
return ret_traddr;
625625
}
626-
627-
#else /* !HAVE_LIBNSS */
628-
626+
#else /* HAVE_NETDB */
629627
char *hostname2traddr(struct nvme_root *r, const char *traddr)
630628
{
631629
nvme_msg(NULL, LOG_ERR, "No support for hostname IP address resolution; " \
@@ -634,7 +632,7 @@ char *hostname2traddr(struct nvme_root *r, const char *traddr)
634632
errno = -ENOTSUP;
635633
return NULL;
636634
}
637-
#endif /* HAVE_LIBNSS */
635+
#endif /* HAVE_NETDB */
638636

639637
char *startswith(const char *s, const char *prefix)
640638
{

0 commit comments

Comments
 (0)