Conditional compilation for @getnetbyname@, since Cygwin doesn't have
authormdw <mdw>
Sun, 13 Jan 2002 14:49:56 +0000 (14:49 +0000)
committermdw <mdw>
Sun, 13 Jan 2002 14:49:56 +0000 (14:49 +0000)
it.

inet.c

diff --git a/inet.c b/inet.c
index a9a559e..f98c7fa 100644 (file)
--- a/inet.c
+++ b/inet.c
@@ -1,6 +1,6 @@
 /* -*-c-*-
  *
- * $Id: inet.c,v 1.3 2000/08/01 17:59:56 mdw Exp $
+ * $Id: inet.c,v 1.4 2002/01/13 14:49:56 mdw Exp $
  *
  * Protocol specific definitions for IPv4 sockets
  *
 /*----- Revision history --------------------------------------------------* 
  *
  * $Log: inet.c,v $
+ * Revision 1.4  2002/01/13 14:49:56  mdw
+ * Conditional compilation for @getnetbyname@, since Cygwin doesn't have
+ * it.
+ *
  * Revision 1.3  2000/08/01 17:59:56  mdw
  * Switch over to using `size_t' for socket address lengths.
  *
@@ -197,9 +201,12 @@ static int inet_option(scanner *sc, addr_opts *ao)
     if (sc->t == CTOK_WORD && strcmp(sc->d.buf, "from") == 0)
       token(sc);
     conf_name(sc, '.', &d);
+#ifdef HAVE_GETNETBYNAME
     if ((n = getnetbyname(d.buf)) != 0)
       a.s_addr = htonl(n->n_net);
-    else if ((h = gethostbyname(d.buf)) == 0)
+    else
+#endif
+    if ((h = gethostbyname(d.buf)) == 0)
       error(sc, "couldn't resolve address `%s'", d.buf);
     else
       memcpy(&a, h->h_addr, sizeof(struct in_addr));