about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--Src/Modules/zftp.c9
-rw-r--r--acconfig.h3
-rw-r--r--aczsh.m428
-rw-r--r--zshconfig.ac52
5 files changed, 72 insertions, 26 deletions
diff --git a/ChangeLog b/ChangeLog
index 356d904f7..0cf9a9028 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2001-06-19  Andrej Borsenkow  <bor@zsh.org>
+
+	* 14973: acconfig.h, aczsh.m4, zshconfig.ac, Src/Modules/zftp.c:
+	fix for reported problems on AIX 4.x. Still no feedback if it
+	finally works (or even compiles)
+
 2001-06-18  Sven Wischnowsky  <wischnow@zsh.org>
 
 	* 14962: Completion/Unix/Type/_path_files: make special-dirs
diff --git a/Src/Modules/zftp.c b/Src/Modules/zftp.c
index e6fa9eb79..7e511c63e 100644
--- a/Src/Modules/zftp.c
+++ b/Src/Modules/zftp.c
@@ -972,7 +972,8 @@ zfopendata(char *name, union tcp_sockaddr *zdsockp, int *is_passivep)
 #else
 	char portcmd[40];
 #endif
-	int ret, len;
+	SOCKLEN_T len;
+	int ret;
 
 	if (!(zfprefs & ZFPF_SNDP)) {
 	    zwarnnam(name, "only sendport mode available for data", NULL, 0);
@@ -1064,7 +1065,8 @@ zfclosedata(void)
 static int
 zfgetdata(char *name, char *rest, char *cmd, int getsize)
 {
-    int len, newfd, is_passive;
+    SOCKLEN_T len;
+    int newfd, is_passive;
     union tcp_sockaddr zdsock;
 
     if (zfopendata(name, &zdsock, &is_passive))
@@ -1698,7 +1700,8 @@ zftp_open(char *name, char **args, int flags)
     struct servent *zservp;
     struct hostent *zhostp = NULL;
     char **addrp, *fname;
-    int err, len, tmout;
+    int err, tmout;
+    SOCKLEN_T  len;
     int herrno, af, hlen;
 
     if (!*args) {
diff --git a/acconfig.h b/acconfig.h
index 733782f8d..2276d7d1d 100644
--- a/acconfig.h
+++ b/acconfig.h
@@ -320,3 +320,6 @@
 
 /* Define if term.h chokes without curses.h */
 #undef TERM_H_NEEDS_CURSES_H
+
+/* Define to the base type of the third argument of accept */
+#undef SOCKLEN_T
diff --git a/aczsh.m4 b/aczsh.m4
index 45334b6dc..d1419e21e 100644
--- a/aczsh.m4
+++ b/aczsh.m4
@@ -683,3 +683,31 @@ AC_DEFUN(zsh_COMPILE_FLAGS,
 	then LIBS="$4"
 	else LIBS="$enable_libs"
 	fi)])
+
+dnl 
+dnl zsh_CHECK_SOCKLEN_T
+dnl
+dnl	check type of third argument of some network functions; currently
+dnl	tested are size_t *, unsigned long *, int *.
+dnl
+AC_DEFUN([zsh_CHECK_SOCKLEN_T],[
+  AC_CACHE_CHECK(
+    [base type of the third argument to accept],
+    [zsh_cv_type_socklen_t],
+    [zsh_cv_type_socklen_t=
+    for zsh_type in int "unsigned long" size_t ; do
+      AC_TRY_COMPILE(
+        [#include <sys/types.h>
+         #include <sys/socket.h>],
+        [extern int accept (int, struct sockaddr *, $zsh_type *);],
+        [zsh_cv_type_socklen_t="$zsh_type"; break],
+        []
+      )
+    done
+    if test -z "$zsh_cv_type_socklen_t"; then
+      zsh_cv_type_socklen_t=int
+    fi]
+  )
+  AC_DEFINE_UNQUOTED([SOCKLEN_T], [$zsh_cv_type_socklen_t])]
+)
+
diff --git a/zshconfig.ac b/zshconfig.ac
index 549aac81e..258d64e19 100644
--- a/zshconfig.ac
+++ b/zshconfig.ac
@@ -1486,6 +1486,12 @@ fi
 
 
 dnl ---------------
+dnl check for the type of third argument of accept
+dnl ---------------
+
+zsh_CHECK_SOCKLEN_T
+
+dnl ---------------
 dnl dynamic loading
 dnl ---------------
 L=N
@@ -1497,29 +1503,30 @@ MOD_IMPORT_VARIABLE=
 MOD_IMPORT_FUNCTION=
 aixdynamic=no
 hpuxdynamic=no
-if test "$ac_cv_func_dlopen"  != yes ||
-   test "$ac_cv_func_dlsym"   != yes ||
-   test "$ac_cv_func_dlerror" != yes; then
-  if test "$ac_cv_func_load"      != yes ||
-     test "$ac_cv_func_unload"    != yes ||
-     test "$ac_cv_func_loadbind"  != yes ||
-     test "$ac_cv_func_loadquery" != yes; then
-    if test "$ac_cv_func_shl_load" != yes ||
-       test "$ac_cv_func_shl_unload" != yes ||
-       test "$ac_cv_func_shl_findsym" != yes; then
-      dynamic=no
-    elif test "x$dynamic" = xyes; then
-      hpuxdynamic=yes
-      DL_EXT="${DL_EXT=sl}"
-      dnl autoheader won't allow us to define anything which isn't
-      dnl going into a header, and we can't undefine anything, so
-      dnl just define this anyway and rely on the later tests to
-      dnl define DYNAMIC or not.
-      AC_DEFINE(HPUXDYNAMIC)dnl
-    fi
-  elif test "x$dynamic" = xyes; then
+if test "$ac_cv_func_load"      = yes &&
+   test "$ac_cv_func_unload"    = yes &&
+   test "$ac_cv_func_loadbind"  = yes &&
+   test "$ac_cv_func_loadquery" = yes; then
+  dnl Force AIXDYNAMIC even on newer versions that have dl family
+  if test "x$dynamic" = xyes; then
     aixdynamic=yes
   fi
+elif test "$ac_cv_func_dlopen"  != yes ||
+     test "$ac_cv_func_dlsym"   != yes ||
+     test "$ac_cv_func_dlerror" != yes; then
+  if test "$ac_cv_func_shl_load" != yes ||
+     test "$ac_cv_func_shl_unload" != yes ||
+     test "$ac_cv_func_shl_findsym" != yes; then
+    dynamic=no
+  elif test "x$dynamic" = xyes; then
+    hpuxdynamic=yes
+    DL_EXT="${DL_EXT=sl}"
+    dnl autoheader won't allow us to define anything which isn't
+    dnl going into a header, and we can't undefine anything, so
+    dnl just define this anyway and rely on the later tests to
+    dnl define DYNAMIC or not.
+    AC_DEFINE(HPUXDYNAMIC)dnl
+  fi
 fi
 
 test -n "$GCC" && LDARG=-Wl,
@@ -1537,7 +1544,7 @@ if test "x$aixdynamic" = xyes; then
   zsh_cv_sys_dynamic_execsyms="${zsh_cv_sys_dynamic_execsyms=yes}"
   zsh_cv_sys_dynamic_strip_exe="${zsh_cv_sys_dynamic_strip_exe=yes}"
   zsh_cv_sys_dynamic_strip_lib="${zsh_cv_sys_dynamic_strip_lib=yes}"
-  zsh_cv_sys_dynamic_broken="${zsh_cv_sys_dynamic_broken=no}"
+  zsh_cv_shared_environ="${zsh_cv_shared_environ=yes}"
 elif test "$host_os" = cygwin; then
   DL_EXT="${DL_EXT=dll}"
   DLLD="${DLLD=dllwrap}"
@@ -1723,7 +1730,6 @@ fi
 if test "x$dynamic" = xyes; then
   zsh_SHARED_VARIABLE([environ], [char **])
   test "$zsh_cv_shared_environ" = yes || dynamic=no
-dnl  test "$zsh_cv_sys_dynamic_broken" = no || dynamic=no
   if test "$ac_cv_func_tgetent" = yes; then
     zsh_SHARED_FUNCTION([tgetent])
   fi