File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -905,7 +905,9 @@ int nvme_uuid_random(unsigned char uuid[NVME_UUID_LEN])
905905 return 0 ;
906906}
907907
908- bool nvme_ipaddrs_eq (const char * addr1 , const char * addr2 ) {
908+ #ifdef HAVE_NETDB
909+ bool nvme_ipaddrs_eq (const char * addr1 , const char * addr2 )
910+ {
909911 bool result = false;
910912 struct addrinfo * info1 = NULL , hint1 = { .ai_flags = AI_NUMERICHOST , .ai_family = AF_UNSPEC };
911913 struct addrinfo * info2 = NULL , hint2 = { .ai_flags = AI_NUMERICHOST , .ai_family = AF_UNSPEC };
@@ -961,4 +963,12 @@ bool nvme_ipaddrs_eq(const char *addr1, const char *addr2) {
961963 freeaddrinfo (info2 );
962964 return result ;
963965}
966+ #else /* HAVE_NETDB */
967+ bool nvme_ipaddrs_eq (const char * addr1 , const char * addr2 )
968+ {
969+ nvme_msg (NULL , LOG_ERR , "no support for hostname ip address resolution; " \
970+ "recompile with libnss support.\n" );
964971
972+ return false;
973+ }
974+ #endif /* HAVE_NETDB */
Original file line number Diff line number Diff line change @@ -66,20 +66,22 @@ uuid = executable(
6666
6767test (' uuid' , uuid)
6868
69- tree = executable (
70- ' tree' ,
71- [' tree.c' ],
72- dependencies : libnvme_dep,
73- include_directories : [incdir, internal_incdir]
74- )
69+ if conf.get(' HAVE_NETDB' )
70+ tree = executable (
71+ ' tree' ,
72+ [' tree.c' ],
73+ dependencies : libnvme_dep,
74+ include_directories : [incdir, internal_incdir]
75+ )
7576
76- test (' tree' , tree)
77+ test (' tree' , tree)
7778
78- test_util = executable (
79- ' test-util' ,
80- [' test-util.c' ],
81- include_directories : [incdir, internal_incdir]
82- )
83- test (' Test util.c' , test_util)
79+ test_util = executable (
80+ ' test-util' ,
81+ [' test-util.c' ],
82+ include_directories : [incdir, internal_incdir]
83+ )
84+ test (' Test util.c' , test_util)
85+ endif
8486
8587subdir (' nbft' )
You can’t perform that action at this time.
0 commit comments