zsh-workers
 help / color / mirror / code / Atom feed
* Re: PATCH: zftp without inet_aton()
@ 1999-12-01  9:09 Sven Wischnowsky
  1999-12-01  9:30 ` Zefram
  0 siblings, 1 reply; 3+ messages in thread
From: Sven Wischnowsky @ 1999-12-01  9:09 UTC (permalink / raw)
  To: zsh-workers


Zefram wrote:

> This should fix zftp for systems that lack inet_aton().  I haven't tested
> it on such a system, however.

It doesn't. For me at least:

gcc -c -I.  -DHAVE_CONFIG_H -DMODULE -Wall -Wno-implicit -Wmissing-prototypes -ggdb
-fpic -o zftp..o zftp.c
In file included from zftp.c:53:
zftp.pro:35: warning: `struct in_addr' declared inside parameter list
zftp.pro:35: warning: its scope is only this definition or declaration,
zftp.pro:35: warning: which is probably not what you want.
In file included from zftp.c:60:
/usr/include/arpa/inet.h:72: conflicting types for `inet_aton'
zftp.pro:35: previous declaration of `inet_aton'
make[2]: *** [zftp..o] Error 1


Quick fix below (can't move the includes below the arpa thingies
because at least my arpa/telnet.h #defines DO, which would then cause
mishap in zsh.h:212).

Bye
 Sven

--- Src/Modules/zftp.c.old	Wed Dec  1 10:04:32 1999
+++ Src/Modules/zftp.c	Wed Dec  1 10:05:58 1999
@@ -49,14 +49,15 @@
 struct zftp_session;
 typedef struct zftp_session *Zftp_session;
 
-#include "zftp.mdh"
-#include "zftp.pro"
-
 #include <sys/socket.h>
 #include <netdb.h>
 #include <netinet/in_systm.h>
 #include <netinet/in.h>
 #include <netinet/ip.h>
+
+#include "zftp.mdh"
+#include "zftp.pro"
+
 #include <arpa/inet.h>
 /* it's a TELNET based protocol, but don't think I like doing this */
 #include <arpa/telnet.h>

--
Sven Wischnowsky                         wischnow@informatik.hu-berlin.de


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: PATCH: zftp without inet_aton()
  1999-12-01  9:09 PATCH: zftp without inet_aton() Sven Wischnowsky
@ 1999-12-01  9:30 ` Zefram
  0 siblings, 0 replies; 3+ messages in thread
From: Zefram @ 1999-12-01  9:30 UTC (permalink / raw)
  To: Sven Wischnowsky; +Cc: zsh-workers

Sven Wischnowsky wrote:
>Quick fix below (can't move the includes below the arpa thingies
>because at least my arpa/telnet.h #defines DO, which would then cause
>mishap in zsh.h:212).

The proper fix is to add struct in_addr to the list of forward structure
declarations.  This patch applies on top of 8831, though only to
reverse it.

-zefram

diff -u -r ../zsh-/Src/Modules/zftp.c ./Src/Modules/zftp.c
--- ../zsh-/Src/Modules/zftp.c	Wed Dec  1 09:26:06 1999
+++ ./Src/Modules/zftp.c	Wed Dec  1 09:27:42 1999
@@ -43,21 +43,21 @@
 
 /* needed in prototypes for statics */
 struct hostent;
+struct in_addr;
 struct sockaddr_in;
 struct sockaddr_in6;
 union zftp_sockaddr;
 struct zftp_session;
 typedef struct zftp_session *Zftp_session;
 
+#include "zftp.mdh"
+#include "zftp.pro"
+
 #include <sys/socket.h>
 #include <netdb.h>
 #include <netinet/in_systm.h>
 #include <netinet/in.h>
 #include <netinet/ip.h>
-
-#include "zftp.mdh"
-#include "zftp.pro"
-
 #include <arpa/inet.h>
 /* it's a TELNET based protocol, but don't think I like doing this */
 #include <arpa/telnet.h>
END


^ permalink raw reply	[flat|nested] 3+ messages in thread

* PATCH: zftp without inet_aton()
@ 1999-11-30 18:15 zefram
  0 siblings, 0 replies; 3+ messages in thread
From: zefram @ 1999-11-30 18:15 UTC (permalink / raw)
  To: zsh-workers

This should fix zftp for systems that lack inet_aton().  I haven't tested
it on such a system, however.

-zefram

diff -cr ../zsh-/Src/Modules/zftp.c ./Src/Modules/zftp.c
*** ../zsh-/Src/Modules/zftp.c	Sun Nov 28 17:42:28 1999
--- ./Src/Modules/zftp.c	Tue Nov 30 18:04:01 1999
***************
*** 126,131 ****
--- 126,147 ----
  #ifndef HAVE_INET_PTON
  
  /**/
+ # ifndef HAVE_INET_ATON
+ 
+ #  ifndef INADDR_NONE
+ #   define INADDR_NONE 0xffffffffUL
+ #  endif
+ 
+ /**/
+ static int inet_aton(char const *src, struct in_addr *dst)
+ {
+     return (dst->s_addr = inet_addr(src)) != INADDR_NONE;
+ }
+ 
+ /**/
+ # endif /* !HAVE_INET_ATON */
+ 
+ /**/
  static int
  inet_pton(int af, char const *src, void *dst)
  {
diff -cr ../zsh-/configure.in ./configure.in
*** ../zsh-/configure.in	Sun Nov 28 17:42:26 1999
--- ./configure.in	Tue Nov 30 17:57:13 1999
***************
*** 791,797 ****
                sigprocmask setuid seteuid setreuid setresuid setsid strerror \
                nis_list initgroups fchdir cap_get_proc readlink nice \
  	      getgrgid getgrnam getpwent getpwnam getpwuid setpgrp \
! 	      inet_pton inet_ntop getipnodebyname gethostbyname2 \
  	      fseeko ftello mmap munmap msync ftruncate setlocale)
  
  dnl ---------------
--- 791,797 ----
                sigprocmask setuid seteuid setreuid setresuid setsid strerror \
                nis_list initgroups fchdir cap_get_proc readlink nice \
  	      getgrgid getgrnam getpwent getpwnam getpwuid setpgrp \
! 	      inet_aton inet_pton inet_ntop getipnodebyname gethostbyname2 \
  	      fseeko ftello mmap munmap msync ftruncate setlocale)
  
  dnl ---------------
END


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~1999-12-01  9:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-12-01  9:09 PATCH: zftp without inet_aton() Sven Wischnowsky
1999-12-01  9:30 ` Zefram
  -- strict thread matches above, loose matches on Subject: below --
1999-11-30 18:15 zefram

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).