Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

PATCH: 3.1.5-pws-3: INADDR_NONE



Bruce Stephens wrote:
> zftp.c fails to compile:
> 
> /* bet there are machines which have neither INADDR_NONE nor in_addr_t. */
> 
> Lucky guess!  Solaris 2.5.1 seems to have s_addr as a u_long, so I
> just replaced (in_addr_t) with (u_long), and it seems to work.  I
> think, anyway.  I'm assuming this either catches the case when a
> hostname can't be resolved (which I checked using a name that doesn't
> exist), or when DNS server can't be contacted (which I haven't
> checked).

It was there on 2.6.  The definition I have is just 32 bits all ones,
and I think that's standard.

It's only used when trying to match an IP number in dot format, before
it tries a name lookup, so if name lookup is working at all it means
it understands what you did.

*** Src/Modules/zftp.c.zftp3	Fri Dec 11 11:17:15 1998
--- Src/Modules/zftp.c	Tue Dec 15 15:40:18 1998
***************
*** 62,70 ****
  /* it's a TELNET based protocol, but don't think I like doing this */
  #include <arpa/telnet.h>
  
! /* bet there are machines which have neither INADDR_NONE nor in_addr_t. */
  #ifndef INADDR_NONE
! #define INADDR_NONE (in_addr_t)-1
  #endif
  
  /*
--- 62,70 ----
  /* it's a TELNET based protocol, but don't think I like doing this */
  #include <arpa/telnet.h>
  
! /* pinch the definition from <netinet/in.h> for deficient headers */
  #ifndef INADDR_NONE
! #define INADDR_NONE 0xffffffff
  #endif
  
  /*

-- 
Peter Stephenson <pws@xxxxxxxxxxxxxxxxx>       Tel: +39 050 844536
WWW:  http://www.ifh.de/~pws/
Dipartimento di Fisica, Via Buonarroti 2, 56127 Pisa, Italy



Messages sorted by: Reverse Date, Date, Thread, Author