Browse code

removed r_gethostbyname which was not used

aCaB authored on 2009/10/15 02:10:38
Showing 10 changed files
... ...
@@ -1,3 +1,7 @@
1
+Wed Oct 14 19:03:47 CEST 2009 (acab)
2
+------------------------------------
3
+ * win32: remove stale netcode
4
+
1 5
 Wed Oct 14 18:59:13 CEST 2009 (acab)
2 6
 ------------------------------------
3 7
  * win32: preliminary winsock support files
... ...
@@ -187,15 +187,6 @@
187 187
 /* have getaddrinfo() */
188 188
 #undef HAVE_GETADDRINFO
189 189
 
190
-/* gethostbyname_r takes 3 arguments */
191
-#undef HAVE_GETHOSTBYNAME_R_3
192
-
193
-/* gethostbyname_r takes 5 arguments */
194
-#undef HAVE_GETHOSTBYNAME_R_5
195
-
196
-/* gethostbyname_r takes 6 arguments */
197
-#undef HAVE_GETHOSTBYNAME_R_6
198
-
199 190
 /* Define to 1 if getpagesize() is available */
200 191
 #undef HAVE_GETPAGESIZE
201 192
 
... ...
@@ -29,8 +29,6 @@ clamd_SOURCES = \
29 29
     $(top_srcdir)/shared/getopt.h \
30 30
     $(top_srcdir)/shared/misc.c \
31 31
     $(top_srcdir)/shared/misc.h \
32
-    $(top_srcdir)/shared/network.c \
33
-    $(top_srcdir)/shared/network.h \
34 32
     clamd.c \
35 33
     tcpserver.c \
36 34
     tcpserver.h \
... ...
@@ -78,8 +78,7 @@ am__clamd_SOURCES_DIST = $(top_srcdir)/shared/output.c \
78 78
 	$(top_srcdir)/shared/output.h $(top_srcdir)/shared/optparser.c \
79 79
 	$(top_srcdir)/shared/optparser.h $(top_srcdir)/shared/getopt.c \
80 80
 	$(top_srcdir)/shared/getopt.h $(top_srcdir)/shared/misc.c \
81
-	$(top_srcdir)/shared/misc.h $(top_srcdir)/shared/network.c \
82
-	$(top_srcdir)/shared/network.h clamd.c tcpserver.c tcpserver.h \
81
+	$(top_srcdir)/shared/misc.h clamd.c tcpserver.c tcpserver.h \
83 82
 	localserver.c localserver.h session.c session.h thrmgr.c \
84 83
 	thrmgr.h server-th.c server.h scanner.c scanner.h others.c \
85 84
 	others.h clamuko.c clamuko.h clamukofs.c clamukofs.h \
... ...
@@ -87,12 +86,12 @@ am__clamd_SOURCES_DIST = $(top_srcdir)/shared/output.c \
87 87
 	dazuko_xp.h dazukoio_xp.h dazukofs.c dazukofs.h shared.h
88 88
 @BUILD_CLAMD_TRUE@am_clamd_OBJECTS = output.$(OBJEXT) \
89 89
 @BUILD_CLAMD_TRUE@	optparser.$(OBJEXT) getopt.$(OBJEXT) \
90
-@BUILD_CLAMD_TRUE@	misc.$(OBJEXT) network.$(OBJEXT) \
91
-@BUILD_CLAMD_TRUE@	clamd.$(OBJEXT) tcpserver.$(OBJEXT) \
92
-@BUILD_CLAMD_TRUE@	localserver.$(OBJEXT) session.$(OBJEXT) \
93
-@BUILD_CLAMD_TRUE@	thrmgr.$(OBJEXT) server-th.$(OBJEXT) \
94
-@BUILD_CLAMD_TRUE@	scanner.$(OBJEXT) others.$(OBJEXT) \
95
-@BUILD_CLAMD_TRUE@	clamuko.$(OBJEXT) clamukofs.$(OBJEXT) \
90
+@BUILD_CLAMD_TRUE@	misc.$(OBJEXT) clamd.$(OBJEXT) \
91
+@BUILD_CLAMD_TRUE@	tcpserver.$(OBJEXT) localserver.$(OBJEXT) \
92
+@BUILD_CLAMD_TRUE@	session.$(OBJEXT) thrmgr.$(OBJEXT) \
93
+@BUILD_CLAMD_TRUE@	server-th.$(OBJEXT) scanner.$(OBJEXT) \
94
+@BUILD_CLAMD_TRUE@	others.$(OBJEXT) clamuko.$(OBJEXT) \
95
+@BUILD_CLAMD_TRUE@	clamukofs.$(OBJEXT) \
96 96
 @BUILD_CLAMD_TRUE@	dazukoio_compat12.$(OBJEXT) \
97 97
 @BUILD_CLAMD_TRUE@	dazukoio.$(OBJEXT) dazukofs.$(OBJEXT)
98 98
 clamd_OBJECTS = $(am_clamd_OBJECTS)
... ...
@@ -297,8 +296,6 @@ top_srcdir = @top_srcdir@
297 297
 @BUILD_CLAMD_TRUE@    $(top_srcdir)/shared/getopt.h \
298 298
 @BUILD_CLAMD_TRUE@    $(top_srcdir)/shared/misc.c \
299 299
 @BUILD_CLAMD_TRUE@    $(top_srcdir)/shared/misc.h \
300
-@BUILD_CLAMD_TRUE@    $(top_srcdir)/shared/network.c \
301
-@BUILD_CLAMD_TRUE@    $(top_srcdir)/shared/network.h \
302 300
 @BUILD_CLAMD_TRUE@    clamd.c \
303 301
 @BUILD_CLAMD_TRUE@    tcpserver.c \
304 302
 @BUILD_CLAMD_TRUE@    tcpserver.h \
... ...
@@ -446,7 +443,6 @@ distclean-compile:
446 446
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getopt.Po@am__quote@
447 447
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/localserver.Po@am__quote@
448 448
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/misc.Po@am__quote@
449
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/network.Po@am__quote@
450 449
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/optparser.Po@am__quote@
451 450
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/others.Po@am__quote@
452 451
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/output.Po@am__quote@
... ...
@@ -544,22 +540,6 @@ misc.obj: $(top_srcdir)/shared/misc.c
544 544
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
545 545
 @am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o misc.obj `if test -f '$(top_srcdir)/shared/misc.c'; then $(CYGPATH_W) '$(top_srcdir)/shared/misc.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/shared/misc.c'; fi`
546 546
 
547
-network.o: $(top_srcdir)/shared/network.c
548
-@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT network.o -MD -MP -MF $(DEPDIR)/network.Tpo -c -o network.o `test -f '$(top_srcdir)/shared/network.c' || echo '$(srcdir)/'`$(top_srcdir)/shared/network.c
549
-@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/network.Tpo $(DEPDIR)/network.Po
550
-@am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
551
-@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$(top_srcdir)/shared/network.c' object='network.o' libtool=no @AMDEPBACKSLASH@
552
-@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
553
-@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o network.o `test -f '$(top_srcdir)/shared/network.c' || echo '$(srcdir)/'`$(top_srcdir)/shared/network.c
554
-
555
-network.obj: $(top_srcdir)/shared/network.c
556
-@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT network.obj -MD -MP -MF $(DEPDIR)/network.Tpo -c -o network.obj `if test -f '$(top_srcdir)/shared/network.c'; then $(CYGPATH_W) '$(top_srcdir)/shared/network.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/shared/network.c'; fi`
557
-@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/network.Tpo $(DEPDIR)/network.Po
558
-@am__fastdepCC_FALSE@	$(AM_V_CC) @AM_BACKSLASH@
559
-@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$(top_srcdir)/shared/network.c' object='network.obj' libtool=no @AMDEPBACKSLASH@
560
-@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
561
-@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o network.obj `if test -f '$(top_srcdir)/shared/network.c'; then $(CYGPATH_W) '$(top_srcdir)/shared/network.c'; else $(CYGPATH_W) '$(srcdir)/$(top_srcdir)/shared/network.c'; fi`
562
-
563 547
 mostlyclean-libtool:
564 548
 	-rm -f *.lo
565 549
 
... ...
@@ -59,7 +59,6 @@
59 59
 #include "others.h"
60 60
 #include "scanner.h"
61 61
 #include "shared.h"
62
-#include "network.h"
63 62
 #include "thrmgr.h"
64 63
 #include "server.h"
65 64
 
... ...
@@ -40,7 +40,6 @@
40 40
 
41 41
 #include "shared/optparser.h"
42 42
 #include "shared/output.h"
43
-#include "shared/network.h"
44 43
 
45 44
 #include "others.h"
46 45
 #include "server.h"
... ...
@@ -970,7 +970,6 @@ enable_no_cache
970 970
 enable_dns_fix
971 971
 enable_bigstack
972 972
 with_dbdir
973
-enable_gethostbyname_r
974 973
 enable_readdir_r
975 974
 enable_fdpassing
976 975
 enable_clamdtop
... ...
@@ -1642,7 +1641,6 @@ Optional Features:
1642 1642
   --enable-no-cache	  use "Cache-Control: no-cache" in freshclam
1643 1643
   --enable-dns-fix	  enable workaround for broken DNS servers (as in SpeedTouch 510)
1644 1644
   --enable-bigstack	  increase thread stack size
1645
-  --disable-gethostbyname_r	  disable support for gethostbyname_r
1646 1645
   --enable-readdir_r		    enable support for readdir_r
1647 1646
   --disable-fdpassing        don't build file descriptor passing support
1648 1647
   --enable-clamdtop       Enable 'clamdtop' tool [default=auto]
... ...
@@ -5130,13 +5128,13 @@ if test "${lt_cv_nm_interface+set}" = set; then :
5130 5130
 else
5131 5131
   lt_cv_nm_interface="BSD nm"
5132 5132
   echo "int some_variable = 0;" > conftest.$ac_ext
5133
-  (eval echo "\"\$as_me:5133: $ac_compile\"" >&5)
5133
+  (eval echo "\"\$as_me:5131: $ac_compile\"" >&5)
5134 5134
   (eval "$ac_compile" 2>conftest.err)
5135 5135
   cat conftest.err >&5
5136
-  (eval echo "\"\$as_me:5136: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
5136
+  (eval echo "\"\$as_me:5134: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
5137 5137
   (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
5138 5138
   cat conftest.err >&5
5139
-  (eval echo "\"\$as_me:5139: output\"" >&5)
5139
+  (eval echo "\"\$as_me:5137: output\"" >&5)
5140 5140
   cat conftest.out >&5
5141 5141
   if $GREP 'External.*some_variable' conftest.out > /dev/null; then
5142 5142
     lt_cv_nm_interface="MS dumpbin"
... ...
@@ -6331,7 +6329,7 @@ ia64-*-hpux*)
6331 6331
   ;;
6332 6332
 *-*-irix6*)
6333 6333
   # Find out which ABI we are using.
6334
-  echo '#line 6334 "configure"' > conftest.$ac_ext
6334
+  echo '#line 6332 "configure"' > conftest.$ac_ext
6335 6335
   if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
6336 6336
   (eval $ac_compile) 2>&5
6337 6337
   ac_status=$?
... ...
@@ -7860,11 +7858,11 @@ else
7860 7860
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
7861 7861
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
7862 7862
    -e 's:$: $lt_compiler_flag:'`
7863
-   (eval echo "\"\$as_me:7863: $lt_compile\"" >&5)
7863
+   (eval echo "\"\$as_me:7861: $lt_compile\"" >&5)
7864 7864
    (eval "$lt_compile" 2>conftest.err)
7865 7865
    ac_status=$?
7866 7866
    cat conftest.err >&5
7867
-   echo "$as_me:7867: \$? = $ac_status" >&5
7867
+   echo "$as_me:7865: \$? = $ac_status" >&5
7868 7868
    if (exit $ac_status) && test -s "$ac_outfile"; then
7869 7869
      # The compiler can only warn and ignore the option if not recognized
7870 7870
      # So say no if there are warnings other than the usual output.
... ...
@@ -8199,11 +8197,11 @@ else
8199 8199
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
8200 8200
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
8201 8201
    -e 's:$: $lt_compiler_flag:'`
8202
-   (eval echo "\"\$as_me:8202: $lt_compile\"" >&5)
8202
+   (eval echo "\"\$as_me:8200: $lt_compile\"" >&5)
8203 8203
    (eval "$lt_compile" 2>conftest.err)
8204 8204
    ac_status=$?
8205 8205
    cat conftest.err >&5
8206
-   echo "$as_me:8206: \$? = $ac_status" >&5
8206
+   echo "$as_me:8204: \$? = $ac_status" >&5
8207 8207
    if (exit $ac_status) && test -s "$ac_outfile"; then
8208 8208
      # The compiler can only warn and ignore the option if not recognized
8209 8209
      # So say no if there are warnings other than the usual output.
... ...
@@ -8304,11 +8302,11 @@ else
8304 8304
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
8305 8305
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
8306 8306
    -e 's:$: $lt_compiler_flag:'`
8307
-   (eval echo "\"\$as_me:8307: $lt_compile\"" >&5)
8307
+   (eval echo "\"\$as_me:8305: $lt_compile\"" >&5)
8308 8308
    (eval "$lt_compile" 2>out/conftest.err)
8309 8309
    ac_status=$?
8310 8310
    cat out/conftest.err >&5
8311
-   echo "$as_me:8311: \$? = $ac_status" >&5
8311
+   echo "$as_me:8309: \$? = $ac_status" >&5
8312 8312
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
8313 8313
    then
8314 8314
      # The compiler can only warn and ignore the option if not recognized
... ...
@@ -8359,11 +8357,11 @@ else
8359 8359
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
8360 8360
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
8361 8361
    -e 's:$: $lt_compiler_flag:'`
8362
-   (eval echo "\"\$as_me:8362: $lt_compile\"" >&5)
8362
+   (eval echo "\"\$as_me:8360: $lt_compile\"" >&5)
8363 8363
    (eval "$lt_compile" 2>out/conftest.err)
8364 8364
    ac_status=$?
8365 8365
    cat out/conftest.err >&5
8366
-   echo "$as_me:8366: \$? = $ac_status" >&5
8366
+   echo "$as_me:8364: \$? = $ac_status" >&5
8367 8367
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
8368 8368
    then
8369 8369
      # The compiler can only warn and ignore the option if not recognized
... ...
@@ -10742,7 +10740,7 @@ else
10742 10742
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
10743 10743
   lt_status=$lt_dlunknown
10744 10744
   cat > conftest.$ac_ext <<_LT_EOF
10745
-#line 10745 "configure"
10745
+#line 10743 "configure"
10746 10746
 #include "confdefs.h"
10747 10747
 
10748 10748
 #if HAVE_DLFCN_H
... ...
@@ -10838,7 +10836,7 @@ else
10838 10838
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
10839 10839
   lt_status=$lt_dlunknown
10840 10840
   cat > conftest.$ac_ext <<_LT_EOF
10841
-#line 10841 "configure"
10841
+#line 10839 "configure"
10842 10842
 #include "confdefs.h"
10843 10843
 
10844 10844
 #if HAVE_DLFCN_H
... ...
@@ -11510,7 +11508,7 @@ else
11510 11510
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
11511 11511
   lt_status=$lt_dlunknown
11512 11512
   cat > conftest.$ac_ext <<_LT_EOF
11513
-#line 11513 "configure"
11513
+#line 11511 "configure"
11514 11514
 #include "confdefs.h"
11515 11515
 
11516 11516
 #if HAVE_DLFCN_H
... ...
@@ -16516,7 +16514,6 @@ $as_echo "#define CLAMUKO 1" >>confdefs.h
16516 16516
 
16517 16517
 $as_echo "#define C_BSD 1" >>confdefs.h
16518 16518
 
16519
-    use_gethostbyname_r="no"
16520 16519
     ;;
16521 16520
 freebsd*)
16522 16521
     if test "$have_pthreads" = "yes"; then
... ...
@@ -16537,7 +16534,6 @@ $as_echo "#define CLAMUKO 1" >>confdefs.h
16537 16537
 
16538 16538
 $as_echo "#define C_BSD 1" >>confdefs.h
16539 16539
 
16540
-    use_gethostbyname_r="no"
16541 16540
     ;;
16542 16541
 dragonfly*)
16543 16542
     if test "$have_pthreads" = "yes"; then
... ...
@@ -16558,7 +16554,6 @@ $as_echo "#define CLAMUKO 1" >>confdefs.h
16558 16558
 
16559 16559
 $as_echo "#define C_BSD 1" >>confdefs.h
16560 16560
 
16561
-    use_gethostbyname_r="no"
16562 16561
     ;;
16563 16562
 openbsd*)
16564 16563
     if test "$have_pthreads" = "yes"; then
... ...
@@ -16576,7 +16571,6 @@ $as_echo "#define _REENTRANT 1" >>confdefs.h
16576 16576
 
16577 16577
 $as_echo "#define C_BSD 1" >>confdefs.h
16578 16578
 
16579
-    use_gethostbyname_r="no"
16580 16579
     ;;
16581 16580
 bsdi*)
16582 16581
     if test "$have_pthreads" = "yes"; then
... ...
@@ -16592,7 +16586,6 @@ $as_echo "#define _REENTRANT 1" >>confdefs.h
16592 16592
 
16593 16593
 $as_echo "#define C_BSD 1" >>confdefs.h
16594 16594
 
16595
-    use_gethostbyname_r="no"
16596 16595
     ;;
16597 16596
 netbsd*)
16598 16597
      if test "$have_pthreads" = "yes"; then
... ...
@@ -16607,7 +16600,6 @@ $as_echo "#define _REENTRANT 1" >>confdefs.h
16607 16607
 
16608 16608
 $as_echo "#define C_BSD 1" >>confdefs.h
16609 16609
 
16610
-    use_gethostbyname_r="no"
16611 16610
     ;;
16612 16611
 bsd*)
16613 16612
     { $as_echo "$as_me:${as_lineno-$LINENO}: result: Unknown BSD detected. Disabling thread support." >&5
... ...
@@ -16616,7 +16608,6 @@ $as_echo "Unknown BSD detected. Disabling thread support." >&6; }
16616 16616
 
16617 16617
 $as_echo "#define C_BSD 1" >>confdefs.h
16618 16618
 
16619
-    use_gethostbyname_r="no"
16620 16619
     ;;
16621 16620
 beos*)
16622 16621
     { $as_echo "$as_me:${as_lineno-$LINENO}: result: BeOS detected. Disabling thread support." >&5
... ...
@@ -16625,7 +16616,6 @@ $as_echo "BeOS detected. Disabling thread support." >&6; }
16625 16625
 
16626 16626
 $as_echo "#define C_BEOS 1" >>confdefs.h
16627 16627
 
16628
-    use_gethostbyname_r="no"
16629 16628
     ;;
16630 16629
 darwin*)
16631 16630
 
... ...
@@ -16638,7 +16628,6 @@ $as_echo "#define C_DARWIN 1" >>confdefs.h
16638 16638
 $as_echo "#define BIND_8_COMPAT 1" >>confdefs.h
16639 16639
 
16640 16640
     use_netinfo="yes"
16641
-    use_gethostbyname_r="no"
16642 16641
     ;;
16643 16642
 os2*)
16644 16643
     FRESHCLAM_LIBS="$FRESHCLAM_LIBS -lsyslog"
... ...
@@ -16674,7 +16663,6 @@ $as_echo "#define _REENTRANT 1" >>confdefs.h
16674 16674
 
16675 16675
 $as_echo "#define C_HPUX 1" >>confdefs.h
16676 16676
 
16677
-    use_gethostbyname_r="no"
16678 16677
     ;;
16679 16678
 aix*)
16680 16679
     if test "$have_pthreads" = "yes"; then
... ...
@@ -16999,121 +16987,6 @@ $as_echo "#define BUILD_CLAMD 1" >>confdefs.h
16999 16999
 
17000 17000
 fi
17001 17001
 
17002
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname_r" >&5
17003
-$as_echo_n "checking for gethostbyname_r... " >&6; }
17004
-if test -z "$ac_cv_gethostbyname_args"; then
17005
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17006
-/* end confdefs.h.  */
17007
-
17008
-#include <sys/types.h>
17009
-#include <netdb.h>
17010
-
17011
-int
17012
-main ()
17013
-{
17014
-
17015
-struct hostent *hp;
17016
-struct hostent h;
17017
-char *name;
17018
-char buffer[10];
17019
-int  h_errno;
17020
-hp = gethostbyname_r(name, &h, buffer, 10, &h_errno);
17021
-
17022
-  ;
17023
-  return 0;
17024
-}
17025
-_ACEOF
17026
-if ac_fn_c_try_compile "$LINENO"; then :
17027
-  ac_cv_gethostbyname_args=5
17028
-fi
17029
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
17030
-fi
17031
-if test -z "$ac_cv_gethostbyname_args"; then
17032
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17033
-/* end confdefs.h.  */
17034
-
17035
-#include <sys/types.h>
17036
-#include <netdb.h>
17037
-
17038
-int
17039
-main ()
17040
-{
17041
-
17042
-struct hostent h;
17043
-struct hostent_data hdata;
17044
-char *name;
17045
-int  rc;
17046
-rc = gethostbyname_r(name, &h, &hdata);
17047
-
17048
-  ;
17049
-  return 0;
17050
-}
17051
-_ACEOF
17052
-if ac_fn_c_try_compile "$LINENO"; then :
17053
-  ac_cv_gethostbyname_args=3
17054
-fi
17055
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
17056
-fi
17057
-if test -z "$ac_cv_gethostbyname_args"; then
17058
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17059
-/* end confdefs.h.  */
17060
-
17061
-#include <sys/types.h>
17062
-#include <netdb.h>
17063
-
17064
-int
17065
-main ()
17066
-{
17067
-
17068
-struct hostent h;
17069
-struct hostent *hp;
17070
-char *name;
17071
-char buf[10];
17072
-int rc;
17073
-int h_errno;
17074
-
17075
-rc = gethostbyname_r(name, &h, buf, 10, &hp, &h_errno);
17076
-
17077
-  ;
17078
-  return 0;
17079
-}
17080
-_ACEOF
17081
-if ac_fn_c_try_compile "$LINENO"; then :
17082
-  ac_cv_gethostbyname_args=6
17083
-fi
17084
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
17085
-fi
17086
-
17087
-# Check whether --enable-gethostbyname_r was given.
17088
-if test "${enable_gethostbyname_r+set}" = set; then :
17089
-  enableval=$enable_gethostbyname_r; use_gethostbyname_r=$enableval
17090
-fi
17091
-
17092
-
17093
-if test "$use_gethostbyname_r" = "no"; then
17094
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: support disabled" >&5
17095
-$as_echo "support disabled" >&6; }
17096
-elif test -z "$ac_cv_gethostbyname_args"; then
17097
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
17098
-$as_echo "no" >&6; }
17099
-else
17100
-    if test "$ac_cv_gethostbyname_args" = 3; then
17101
-
17102
-$as_echo "#define HAVE_GETHOSTBYNAME_R_3 1" >>confdefs.h
17103
-
17104
-    elif test "$ac_cv_gethostbyname_args" = 5; then
17105
-
17106
-$as_echo "#define HAVE_GETHOSTBYNAME_R_5 1" >>confdefs.h
17107
-
17108
-    elif test "$ac_cv_gethostbyname_args" = 6; then
17109
-
17110
-$as_echo "#define HAVE_GETHOSTBYNAME_R_6 1" >>confdefs.h
17111
-
17112
-    fi
17113
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, and it takes $ac_cv_gethostbyname_args arguments" >&5
17114
-$as_echo "yes, and it takes $ac_cv_gethostbyname_args arguments" >&6; }
17115
-fi
17116
-
17117 17002
 
17118 17003
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for readdir_r" >&5
17119 17004
 $as_echo_n "checking for readdir_r... " >&6; }
... ...
@@ -1,5 +1,5 @@
1 1
 dnl   Copyright (C) 2002 - 2006 Tomasz Kojm <tkojm@clamav.net>
2
-dnl   gethostbyname_r and readdir_r checks (c) COPYRIGHT MIT 1995
2
+dnl   readdir_r checks (c) COPYRIGHT MIT 1995
3 3
 dnl   socklen_t check (c) Alexander V. Lukyanov <lav@yars.free.net>
4 4
 dnl
5 5
 dnl   This program is free software; you can redistribute it and/or modify
... ...
@@ -953,7 +953,6 @@ freebsd[[45]]*)
953 953
 	fi
954 954
     fi
955 955
     AC_DEFINE([C_BSD],1,[os is freebsd 4 or 5])
956
-    use_gethostbyname_r="no"
957 956
     ;;
958 957
 freebsd*)
959 958
     if test "$have_pthreads" = "yes"; then
... ...
@@ -966,7 +965,6 @@ freebsd*)
966 966
 	fi
967 967
     fi
968 968
     AC_DEFINE([C_BSD],1,[os is freebsd 6])
969
-    use_gethostbyname_r="no"
970 969
     ;;
971 970
 dragonfly*)
972 971
     if test "$have_pthreads" = "yes"; then
... ...
@@ -979,7 +977,6 @@ dragonfly*)
979 979
 	fi
980 980
     fi
981 981
     AC_DEFINE([C_BSD],1,[os is dragonfly])
982
-    use_gethostbyname_r="no"
983 982
     ;;
984 983
 openbsd*)
985 984
     if test "$have_pthreads" = "yes"; then
... ...
@@ -991,7 +988,6 @@ openbsd*)
991 991
 	AC_DEFINE([_REENTRANT],1,[thread safe])
992 992
     fi
993 993
     AC_DEFINE([C_BSD],1,[os is OpenBSD])
994
-    use_gethostbyname_r="no"
995 994
     ;;
996 995
 bsdi*)
997 996
     if test "$have_pthreads" = "yes"; then
... ...
@@ -1001,7 +997,6 @@ bsdi*)
1001 1001
 	AC_DEFINE([_REENTRANT],1,[thread safe])
1002 1002
     fi
1003 1003
     AC_DEFINE([C_BSD],1,[os is BSDI BSD/OS])
1004
-    use_gethostbyname_r="no"
1005 1004
     ;;
1006 1005
 netbsd*)
1007 1006
      if test "$have_pthreads" = "yes"; then
... ...
@@ -1010,26 +1005,22 @@ netbsd*)
1010 1010
 	AC_DEFINE([_REENTRANT],1,[thread safe])
1011 1011
      fi
1012 1012
     AC_DEFINE([C_BSD],1,[os is NetBSD])
1013
-    use_gethostbyname_r="no"
1014 1013
     ;;
1015 1014
 bsd*)
1016 1015
     AC_MSG_RESULT([Unknown BSD detected. Disabling thread support.])
1017 1016
     have_pthreads="no"
1018 1017
     AC_DEFINE([C_BSD],1,[os is bsd flavor])
1019
-    use_gethostbyname_r="no"
1020 1018
     ;;
1021 1019
 beos*)
1022 1020
     AC_MSG_RESULT([BeOS detected. Disabling thread support.])
1023 1021
     have_pthreads="no"
1024 1022
     AC_DEFINE([C_BEOS],1,[os is beos])
1025
-    use_gethostbyname_r="no"
1026 1023
     ;;
1027 1024
 darwin*)
1028 1025
     AC_DEFINE([C_BSD],1,[os is bsd flavor])
1029 1026
     AC_DEFINE([C_DARWIN],1,[os is darwin])
1030 1027
     AC_DEFINE([BIND_8_COMPAT],1,[enable bind8 compatibility])
1031 1028
     use_netinfo="yes"
1032
-    use_gethostbyname_r="no"
1033 1029
     ;;
1034 1030
 os2*)
1035 1031
     FRESHCLAM_LIBS="$FRESHCLAM_LIBS -lsyslog"
... ...
@@ -1057,7 +1048,6 @@ hpux*)
1057 1057
 	AC_DEFINE([_REENTRANT],1,[thread safe])
1058 1058
     fi
1059 1059
     AC_DEFINE([C_HPUX],1,[os is hpux])
1060
-    use_gethostbyname_r="no"
1061 1060
     ;;
1062 1061
 aix*)
1063 1062
     if test "$have_pthreads" = "yes"; then
... ...
@@ -1169,72 +1159,6 @@ then
1169 1169
     AC_DEFINE([BUILD_CLAMD], 1, "build clamd")
1170 1170
 fi
1171 1171
 
1172
-dnl Check for gethostbyname_r and number of its arguments
1173
-dnl Code from libwww/configure.in
1174
-AC_MSG_CHECKING([for gethostbyname_r])
1175
-if test -z "$ac_cv_gethostbyname_args"; then
1176
-AC_TRY_COMPILE(
1177
-[
1178
-#include <sys/types.h>
1179
-#include <netdb.h>
1180
-],[
1181
-struct hostent *hp;
1182
-struct hostent h;
1183
-char *name;
1184
-char buffer[10];
1185
-int  h_errno;
1186
-hp = gethostbyname_r(name, &h, buffer, 10, &h_errno);
1187
-], ac_cv_gethostbyname_args=5)
1188
-fi
1189
-if test -z "$ac_cv_gethostbyname_args"; then
1190
-AC_TRY_COMPILE(
1191
-[
1192
-#include <sys/types.h>
1193
-#include <netdb.h>
1194
-],[
1195
-struct hostent h;
1196
-struct hostent_data hdata;
1197
-char *name;
1198
-int  rc;
1199
-rc = gethostbyname_r(name, &h, &hdata);
1200
-], ac_cv_gethostbyname_args=3)
1201
-fi
1202
-if test -z "$ac_cv_gethostbyname_args"; then
1203
-AC_TRY_COMPILE(
1204
-[
1205
-#include <sys/types.h>
1206
-#include <netdb.h>
1207
-], [
1208
-struct hostent h;
1209
-struct hostent *hp;
1210
-char *name;
1211
-char buf[10];
1212
-int rc;
1213
-int h_errno;
1214
-
1215
-rc = gethostbyname_r(name, &h, buf, 10, &hp, &h_errno);
1216
-], ac_cv_gethostbyname_args=6)
1217
-fi
1218
-
1219
-AC_ARG_ENABLE([gethostbyname_r],
1220
-[  --disable-gethostbyname_r	  disable support for gethostbyname_r],
1221
-use_gethostbyname_r=$enableval,)
1222
-
1223
-if test "$use_gethostbyname_r" = "no"; then
1224
-    AC_MSG_RESULT([support disabled])
1225
-elif test -z "$ac_cv_gethostbyname_args"; then
1226
-    AC_MSG_RESULT(no)
1227
-else
1228
-    if test "$ac_cv_gethostbyname_args" = 3; then
1229
-	AC_DEFINE([HAVE_GETHOSTBYNAME_R_3],1,[gethostbyname_r takes 3 arguments])
1230
-    elif test "$ac_cv_gethostbyname_args" = 5; then
1231
-	AC_DEFINE([HAVE_GETHOSTBYNAME_R_5],1,[gethostbyname_r takes 5 arguments])
1232
-    elif test "$ac_cv_gethostbyname_args" = 6; then
1233
-	AC_DEFINE([HAVE_GETHOSTBYNAME_R_6],1,[gethostbyname_r takes 6 arguments])
1234
-    fi
1235
-    AC_MSG_RESULT([yes, and it takes $ac_cv_gethostbyname_args arguments])
1236
-fi
1237
-
1238 1172
 dnl Check for readdir_r and number of its arguments
1239 1173
 dnl Code from libwww/configure.in
1240 1174
 
1241 1175
deleted file mode 100644
... ...
@@ -1,101 +0,0 @@
1
-/*
2
- *  Copyright (C) 2007-2009 Sourcefire, Inc.
3
- *
4
- *  Authors: Nigel Horne
5
- *
6
- *  This program is free software; you can redistribute it and/or modify
7
- *  it under the terms of the GNU General Public License as published by
8
- *  the Free Software Foundation; either version 2 of the License, or
9
- *  (at your option) any later version.
10
- *
11
- *  This program is distributed in the hope that it will be useful,
12
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
- *  GNU General Public License for more details.
15
- *
16
- *  You should have received a copy of the GNU General Public License
17
- *  along with this program; if not, write to the Free Software
18
- *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19
- *  MA 02110-1301, USA.
20
- *
21
- */
22
-
23
-#if HAVE_CONFIG_H
24
-#include "clamav-config.h"
25
-#endif
26
-
27
-#include <stdio.h>
28
-
29
-#ifdef	HAVE_STRING_H
30
-#include <string.h>
31
-#endif
32
-
33
-#ifdef HAVE_SYS_TYPES_H
34
-#include <sys/types.h>
35
-#endif
36
-
37
-#ifndef _WIN32
38
-#include <netdb.h>
39
-#endif
40
-
41
-#ifdef CL_NOTHREADS
42
-#undef CL_THREAD_SAFE
43
-#endif
44
-
45
-#ifdef  CL_THREAD_SAFE
46
-#include <pthread.h>
47
-#endif
48
-
49
-#include "network.h"
50
-
51
-/*
52
- * TODO: gethostbyname_r is non-standard so different operating
53
- * systems do it in different ways. Need more examples
54
- * Perhaps we could use res_search()?
55
- *
56
- * Returns 0 for success
57
- */
58
-int r_gethostbyname(const char *hostname, struct hostent *hp, char *buf, size_t len)
59
-{
60
-	struct hostent *hp2;
61
-	int ret = -1;
62
-#if !defined(HAVE_GETHOSTBYNAME_R_6) && !defined(HAVE_GETHOSTBYNAME_R_5) && !defined(HAVE_GETHOSTBYNAME_R_3)
63
-#ifdef  CL_THREAD_SAFE
64
-	static pthread_mutex_t hostent_mutex = PTHREAD_MUTEX_INITIALIZER;
65
-#endif
66
-#endif
67
-
68
-	if((hostname == NULL) || (hp == NULL))
69
-		return -1;
70
-	memset(hp, 0, sizeof(struct hostent));
71
-#if	defined(HAVE_GETHOSTBYNAME_R_6)
72
-	/* e.g. Linux */
73
-	if(gethostbyname_r(hostname, hp, buf, len, &hp2, &ret) < 0)
74
-		return ret;
75
-#elif	defined(HAVE_GETHOSTBYNAME_R_5)
76
-	/* e.g. BSD, Solaris, Cygwin */
77
-	if(gethostbyname_r(hostname, hp, buf, len, &ret) == NULL)
78
-		return ret;
79
-#elif	defined(HAVE_GETHOSTBYNAME_R_3)
80
-	/* e.g. HP/UX, AIX */
81
-	if(gethostbyname_r(hostname, &hp, (struct hostent_data *)buf) < 0)
82
-		return h_errno;
83
-#else
84
-	/* Single thread the code e.g. VS2005 */
85
-#ifdef  CL_THREAD_SAFE
86
-	pthread_mutex_lock(&hostent_mutex);
87
-#endif
88
-	if((hp2 = gethostbyname(hostname)) == NULL) {
89
-#ifdef  CL_THREAD_SAFE
90
-		pthread_mutex_unlock(&hostent_mutex);
91
-#endif
92
-		return h_errno;
93
-	}
94
-	memcpy(hp, hp2, sizeof(struct hostent));
95
-#ifdef  CL_THREAD_SAFE
96
-	pthread_mutex_unlock(&hostent_mutex);
97
-#endif
98
-
99
-#endif
100
-	return 0;
101
-}
102 1
deleted file mode 100644
... ...
@@ -1,36 +0,0 @@
1
-/*
2
- *  Copyright (C) 2007-2009 Sourcefire, Inc.
3
- *
4
- *  Authors: Nigel Horne
5
- *
6
- *  This program is free software; you can redistribute it and/or modify
7
- *  it under the terms of the GNU General Public License as published by
8
- *  the Free Software Foundation; either version 2 of the License, or
9
- *  (at your option) any later version.
10
- *
11
- *  This program is distributed in the hope that it will be useful,
12
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
- *  GNU General Public License for more details.
15
- *
16
- *  You should have received a copy of the GNU General Public License
17
- *  along with this program; if not, write to the Free Software
18
- *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19
- *  MA 02110-1301, USA.
20
- *
21
- */
22
-
23
-#ifndef __NETWORK_H
24
-#define __NETWORK_H
25
-
26
-#ifdef	HAVE_SYS_TYPES_H
27
-#include <sys/types.h>
28
-#endif
29
-
30
-#ifndef	_WIN32
31
-#include <netdb.h>
32
-#endif
33
-
34
-int r_gethostbyname(const char *hostname, struct hostent *hp, char *buf, size_t len);
35
-
36
-#endif