Solaris needs -lsocket and -lnsl and does not support gethostbyname2()

With these changes we build and work on solaris
This commit is contained in:
Ronnie Sahlberg
2011-01-03 10:57:35 +11:00
parent e7c24af75e
commit adfb7326e3
3 changed files with 9 additions and 1 deletions

View File

@@ -84,7 +84,11 @@ iscsi_connect_async(struct iscsi_context *iscsi, const char *portal,
if (inet_pton(AF_INET, addr, &sin->sin_addr) != 1) {
struct hostent *he;
#ifdef HAVE_GETHOSTBYNAME2
he = gethostbyname2(addr, AF_INET);
#else
he = gethostbyname(addr);
#endif
if (he == NULL) {
iscsi_set_error(iscsi, "Invalid target:%s "
"Failed to resolve hostname.", addr);