ソースを参照

* Ported misc solaris compile fixes to 1.2.9

svn: 2574
Bryan Drewery 20 年 前
コミット
a9f0d68914
14 ファイル変更432 行追加28 行削除
  1. 1 0
      autotools/Makefile
  2. 18 0
      autotools/config.h.template
  3. 12 1
      autotools/includes/acinclude.m4
  4. 1 0
      build
  5. 24 0
      config.h.in
  6. 355 2
      configure
  7. 6 0
      src/bg.h
  8. 1 3
      src/compat/inet_aton.c
  9. 3 1
      src/main.c
  10. 2 0
      src/match.c
  11. 3 1
      src/net.c
  12. 0 18
      src/net.h
  13. 4 1
      src/shell.c
  14. 2 1
      src/socket.c

+ 1 - 0
autotools/Makefile

@@ -11,6 +11,7 @@ autoheader:
 	@echo "Autoheader..."
 	@autoheader
 	@echo "" >> config.h.in
+	@cat config.h.template >> config.h.in
 	@echo "/* Defines for pack features */" >> config.h.in
 	@(for define in `sed -n -e 's/^[\+|\-] \([^ ]*\) .*/\1/ p' ../pack/pack.cfg`; do \
 	echo "#undef S_$$define" >> config.h.in; \

+ 18 - 0
autotools/config.h.template

@@ -0,0 +1,18 @@
+/*
+ * Enable IPv6 debugging?
+ */
+#define DEBUG_IPV6 1
+#define HAVE_IPV6 1
+
+/* IPv6 sanity checks. */
+#ifdef USE_IPV6
+#  ifndef HAVE_IPV6
+#    undef USE_IPV6
+#  endif
+#  ifndef HAVE_GETHOSTBYNAME2
+#    ifndef HAVE_GETIPNODEBYNAME
+#      undef USE_IPV6
+#    endif
+#  endif
+#endif
+

+ 12 - 1
autotools/includes/acinclude.m4

@@ -326,6 +326,7 @@ case "$egg_cv_var_system_type" in
     AC_DEFINE(BROKEN_SNPRINTF, 1, [Define to use Eggdrop's snprintf functions without regard to HAVE_SNPRINTF])dnl
   ;;
   SunOS)
+    SUNOS="yes"
   ;;
   *BSD)
     # FreeBSD/OpenBSD/NetBSD
@@ -375,8 +376,11 @@ dnl
 AC_DEFUN([EGG_CHECK_LIBS], 
 [
   AC_CHECK_LIB(socket, socket)
-#  AC_CHECK_LIB(nsl, connect)
+  AC_CHECK_LIB(nsl, connect)
+#  AC_CHECK_LIB(dl, dlopen)
+  AC_CHECK_LIB(nsl, gethostbyname)
   AC_CHECK_LIB(dns, gethostbyname)
+
 #  AC_CHECK_LIB(z, gzopen, ZLIB="-lz")
 #  AC_CHECK_LIB(ssl, SSL_accept, SSL="-lssl -lcrypto", SSL="", -lcrypto) 
 #  AC_CHECK_LIB(ssl, SSL_accept, SSL="-lcrypto", SSL="", -lcrypto) 
@@ -394,6 +398,13 @@ AC_DEFUN([EGG_CHECK_LIBS],
 #        ac_cv_lib_pthread_pthread_mutex_init=yes
 #        ac_cv_lib_pthread=""],
 #        ac_cv_lib_pthread_pthread_mutex_init=no)])])])
+  if test "$SUNOS" = "yes"; then
+    # For suns without yp
+    AC_CHECK_LIB(dl, main)
+    AC_CHECK_LIB(socket, main)
+    AC_CHECK_LIB(nsl, main)
+  fi
+
 ])
 
 dnl  EGG_CHECK_FUNC_VSPRINTF()

+ 1 - 0
build

@@ -221,6 +221,7 @@ elif ! [ $scp = "0" ]; then
   scp -i misc/id_dsa -B -p -C ${builddate}-$os-$ver${d}.tar.${ext} $scp
   rm -rf ${builddate}-$os-$ver${d}.tar.${ext} wraith.$os-$ver${d} ChangeLog-${builddate}.gz
   ssh -i misc/id_dsa bryan@endurance.quadspeedi.net ln -fs ${builddate}-$os-$ver${d}.tar.${ext} public_html/nightly/${os}-current.tar.gz
+  ssh -i misc/id_dsa bryan@endurance.quadspeedi.net ln -fs ${builddate}-$os-$ver${d}.tar.${ext} public_html/nightly/${os}.tar.gz
 fi
 
 

+ 24 - 0
config.h.in

@@ -62,9 +62,15 @@
 /* Define to 1 if you have the `isascii' function. */
 #undef HAVE_ISASCII
 
+/* Define to 1 if you have the `dl' library (-ldl). */
+#undef HAVE_LIBDL
+
 /* Define to 1 if you have the `dns' library (-ldns). */
 #undef HAVE_LIBDNS
 
+/* Define to 1 if you have the `nsl' library (-lnsl). */
+#undef HAVE_LIBNSL
+
 /* Define to 1 if you have the `socket' library (-lsocket). */
 #undef HAVE_LIBSOCKET
 
@@ -370,4 +376,22 @@
 #endif /* HAVE_ST_MTIM */
 
 
+/*
+ * Enable IPv6 debugging?
+ */
+#define DEBUG_IPV6 1
+#define HAVE_IPV6 1
+
+/* IPv6 sanity checks. */
+#ifdef USE_IPV6
+#  ifndef HAVE_IPV6
+#    undef USE_IPV6
+#  endif
+#  ifndef HAVE_GETHOSTBYNAME2
+#    ifndef HAVE_GETIPNODEBYNAME
+#      undef USE_IPV6
+#    endif
+#  endif
+#endif
+
 /* Defines for pack features */

+ 355 - 2
configure

@@ -1,5 +1,5 @@
 #! /bin/sh
-# From configure.ac Revision: 1.46 .
+# From configure.ac Revision: 1.47 .
 # Guess values for system-dependent variables and create Makefiles.
 # Generated by GNU Autoconf 2.59.
 #
@@ -3600,6 +3600,7 @@ cat >>confdefs.h <<\_ACEOF
 _ACEOF
   ;;
   SunOS)
+    SUNOS="yes"
   ;;
   *BSD)
     # FreeBSD/OpenBSD/NetBSD
@@ -3972,7 +3973,153 @@ _ACEOF
 
 fi
 
-#  AC_CHECK_LIB(nsl, connect)
+
+echo "$as_me:$LINENO: checking for connect in -lnsl" >&5
+echo $ECHO_N "checking for connect in -lnsl... $ECHO_C" >&6
+if test "${ac_cv_lib_nsl_connect+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lnsl  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char connect ();
+int
+main ()
+{
+connect ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_cxx_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_nsl_connect=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_nsl_connect=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_connect" >&5
+echo "${ECHO_T}$ac_cv_lib_nsl_connect" >&6
+if test $ac_cv_lib_nsl_connect = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBNSL 1
+_ACEOF
+
+  LIBS="-lnsl $LIBS"
+
+fi
+
+#  AC_CHECK_LIB(dl, dlopen)
+
+echo "$as_me:$LINENO: checking for gethostbyname in -lnsl" >&5
+echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6
+if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lnsl  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char gethostbyname ();
+int
+main ()
+{
+gethostbyname ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_cxx_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_nsl_gethostbyname=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_nsl_gethostbyname=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_gethostbyname" >&5
+echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6
+if test $ac_cv_lib_nsl_gethostbyname = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBNSL 1
+_ACEOF
+
+  LIBS="-lnsl $LIBS"
+
+fi
+
 
 echo "$as_me:$LINENO: checking for gethostbyname in -ldns" >&5
 echo $ECHO_N "checking for gethostbyname in -ldns... $ECHO_C" >&6
@@ -4046,6 +4193,7 @@ _ACEOF
 
 fi
 
+
 #  AC_CHECK_LIB(z, gzopen, ZLIB="-lz")
 #  AC_CHECK_LIB(ssl, SSL_accept, SSL="-lssl -lcrypto", SSL="", -lcrypto)
 #  AC_CHECK_LIB(ssl, SSL_accept, SSL="-lcrypto", SSL="", -lcrypto)
@@ -4063,6 +4211,211 @@ fi
 #        ac_cv_lib_pthread_pthread_mutex_init=yes
 #        ac_cv_lib_pthread=""],
 #        ac_cv_lib_pthread_pthread_mutex_init=no)])])])
+  if test "$SUNOS" = "yes"; then
+    # For suns without yp
+
+echo "$as_me:$LINENO: checking for main in -ldl" >&5
+echo $ECHO_N "checking for main in -ldl... $ECHO_C" >&6
+if test "${ac_cv_lib_dl_main+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+
+int
+main ()
+{
+main ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_cxx_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_dl_main=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_dl_main=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_dl_main" >&5
+echo "${ECHO_T}$ac_cv_lib_dl_main" >&6
+if test $ac_cv_lib_dl_main = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBDL 1
+_ACEOF
+
+  LIBS="-ldl $LIBS"
+
+fi
+
+
+echo "$as_me:$LINENO: checking for main in -lsocket" >&5
+echo $ECHO_N "checking for main in -lsocket... $ECHO_C" >&6
+if test "${ac_cv_lib_socket_main+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lsocket  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+
+int
+main ()
+{
+main ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_cxx_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_socket_main=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_socket_main=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_socket_main" >&5
+echo "${ECHO_T}$ac_cv_lib_socket_main" >&6
+if test $ac_cv_lib_socket_main = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBSOCKET 1
+_ACEOF
+
+  LIBS="-lsocket $LIBS"
+
+fi
+
+
+echo "$as_me:$LINENO: checking for main in -lnsl" >&5
+echo $ECHO_N "checking for main in -lnsl... $ECHO_C" >&6
+if test "${ac_cv_lib_nsl_main+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lnsl  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+
+int
+main ()
+{
+main ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_cxx_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_nsl_main=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_nsl_main=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_main" >&5
+echo "${ECHO_T}$ac_cv_lib_nsl_main" >&6
+if test $ac_cv_lib_nsl_main = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBNSL 1
+_ACEOF
+
+  LIBS="-lnsl $LIBS"
+
+fi
+
+  fi
+
 
 
 # Checks for header files

+ 6 - 0
src/bg.h

@@ -1,10 +1,16 @@
 #ifndef _BG_H
 #define _BG_H
 
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
 #include <sys/types.h>
 
 extern time_t 		lastfork;
+#if !defined(CYGWIN_HACKS) && !defined(__sun__)
 extern pid_t 		watcher;
+#endif
 
 pid_t do_fork();
 int close_tty();

+ 1 - 3
src/compat/inet_aton.c

@@ -85,9 +85,7 @@ static char rcsid[] = "$-Id: inet_addr.c,v 1.11 1999/04/29 18:19:53 drepper Exp
  * cannot distinguish between failure and a local broadcast address.
  */
 int
-egg_inet_aton(cp, addr)
-	const char *cp;
-	struct in_addr *addr;
+egg_inet_aton(const char *cp, struct in_addr *addr)
 {
 	static const u_32bit_t max[4] = { 0xffffffff, 0xffffff, 0xffff, 0xff };
 	register u_32bit_t val;	/* changed from u_long --david */

+ 3 - 1
src/main.c

@@ -49,6 +49,8 @@
 #include <sys/file.h>
 #include <sys/stat.h>
 #include <signal.h>
+#include <limits.h>
+#include <fcntl.h>
 
 #include "chan.h"
 #include "tandem.h"
@@ -868,7 +870,7 @@ printf("out: %s\n", out);
   char buf[SGRAB + 10] = "";
 
   while (1) {
-#ifndef CYGWIN_HACKS
+#if !defined(CYGWIN_HACKS) && !defined(__sun__)
     if (conf.watcher && waitpid(watcher, &status, WNOHANG))
       fatal("watcher PID died/stopped", 0);
 #endif /* !CYGWIN_HACKS */

+ 2 - 0
src/match.c

@@ -266,11 +266,13 @@ match_cidr(const char *s1, const char *s2)
     return 0;
 
   if (aftype == AF_INET6) {
+#ifdef USE_IPV6
     inet_pton(aftype, ip, &ipaddr.u.ipv6.sin6_addr);
     inet_pton(aftype, ipmask, &maskaddr.u.ipv6.sin6_addr);
     if (comp_with_mask(&ipaddr.u.ipv6.sin6_addr.s6_addr, &maskaddr.u.ipv6.sin6_addr.s6_addr, cidrlen) && 
        ((ret = wild_match(mask, address))))
       return ret;
+#endif /* USE_IPV6 */
   } else if (aftype == AF_INET) {
     inet_pton(aftype, ip, &ipaddr.u.ipv4.sin_addr);
     inet_pton(aftype, ipmask, &maskaddr.u.ipv4.sin_addr);

+ 3 - 1
src/net.c

@@ -382,8 +382,10 @@ sock_read(FILE *f)
     }
 
     if (fd >= 0) {
+#ifdef USE_IPV6
       if (!strcmp(type, "af"))
         socklist[fd].af = atoi(buf);
+#endif
       if (!strcmp(type, "host"))
         socklist[fd].host = strdup(buf);
       if (!strcmp(type, "port"))
@@ -790,7 +792,7 @@ int open_telnet(const char *server, port_t port, bool proxy)
 #ifdef USE_IPV6
 int open_address_listen(in_addr_t addr, int af_def, port_t *port)
 #else
-intt open_address_listen(in_addr_t addr, port_t *port)
+int open_address_listen(in_addr_t addr, port_t *port)
 #endif /* USE_IPV6 */
  {
 //  if (firewall[0]) {

+ 0 - 18
src/net.h

@@ -21,24 +21,6 @@
 /* #define HAVE_SSL 1 */
 #endif /* HAVE_OPENSSL_SSL_H */
 
-/*
- * Enable IPv6 debugging?
- */
-#define DEBUG_IPV6 1
-#define HAVE_IPV6 1
-
-/* IPv6 sanity checks. */
-#ifdef USE_IPV6
-#  ifndef HAVE_IPV6
-#    undef USE_IPV6
-#  endif
-#  ifndef HAVE_GETHOSTBYNAME2
-#    ifndef HAVE_GETIPNODEBYNAME
-#      undef USE_IPV6
-#    endif
-#  endif
-#endif
-
 #define SGRAB 2010         /* How much data to allow through sockets. */
 
 enum {

+ 4 - 1
src/shell.c

@@ -365,7 +365,6 @@ void check_trace(int start)
   trace = DET_IGNORE;
 #endif /* DEBUG */
 
-  int x, i;
   pid_t parent = getpid();
 
   /* we send ourselves a SIGTRAP, if we recieve, we're not being traced, otherwise we are. */
@@ -392,6 +391,9 @@ void check_trace(int start)
     if (!start)
       return;
 
+#ifndef __sun__
+    int x, i;
+
   /* now, let's attempt to ptrace ourself */
     switch ((x = fork())) {
       case -1:
@@ -413,6 +415,7 @@ void check_trace(int start)
       default:		//parent
         waitpid(x, NULL, 0);
     }
+#endif
   }
 }
 #endif /* !CYGWIN_HACKS */

+ 2 - 1
src/socket.c

@@ -212,11 +212,12 @@ int socket_ip_to_uint(const char *ip, unsigned int *longip)
         return(0);
 }
 
+#ifdef USE_IPV6
 static char hex_digits[] = {
         '0', '1', '2', '3', '4', '5', '6', '7',
         '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'
 };
-
+#endif /* USE_IPV6 */
 
 /* Converts shorthand ipv6 notation (123:456::789) into long dotted-decimal
  * notation. 'dots' must be 16*4+1 = 128 bytes long. */