[Pkg-clamav-commits] [SCM] Debian repository for ClamAV branch, debian/unstable, updated. debian/0.95+dfsg-1-6156-g094ec9b

aCaB acab at clamav.net
Sun Apr 4 01:05:45 UTC 2010


The following commit has been merged in the debian/unstable branch:
commit 4cd80898e6dbc5f03e6381b36e0728a66c7f35fc
Author: aCaB <acab at clamav.net>
Date:   Thu Sep 24 19:23:21 2009 +0200

    win32#3

diff --git a/ChangeLog b/ChangeLog
index bb67f1b..5552f9a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Thu Sep 24 19:22:24 CEST 2009 (acab)
+------------------------------------
+ * merge a set of win32 patches from Gianluigi Tiesi <sherpya*netfarm.it>
+
 Thu Sep 24 19:09:38 CEST 2009 (acab)
 ------------------------------------
  * drop OS/2 "support"
diff --git a/clamdscan/clamdscan.c b/clamdscan/clamdscan.c
index 6e71ae3..121019d 100644
--- a/clamdscan/clamdscan.c
+++ b/clamdscan/clamdscan.c
@@ -26,7 +26,9 @@
 #include <string.h>
 #include <stdlib.h>
 #include <unistd.h>
+#ifndef _WIN32
 #include <sys/time.h>
+#endif
 #include <time.h>
 #include <signal.h>
 
diff --git a/clamdscan/client.c b/clamdscan/client.c
index 002f3e9..701aadc 100644
--- a/clamdscan/client.c
+++ b/clamdscan/client.c
@@ -30,18 +30,20 @@
 #include <string.h>
 #include <sys/types.h>
 #include <sys/stat.h>
-#include <sys/socket.h>
 #ifdef HAVE_SYS_LIMITS_H
 #include <sys/limits.h>
 #endif
 #ifdef HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#ifndef _WIN32
+#include <sys/socket.h>
 #include <sys/un.h>
 #include <netinet/in.h>
 #include <arpa/inet.h>
 #include <netdb.h>
 #include <utime.h>
+#endif
 #include <errno.h>
 #include <dirent.h>
 #include <fcntl.h>
@@ -67,7 +69,9 @@
 struct sockaddr *mainsa = NULL;
 int mainsasz;
 unsigned long int maxstream;
+#ifndef _WIN32
 static struct sockaddr_un nixsock;
+#endif
 static struct sockaddr_in tcpsock;
 
 
diff --git a/clamdscan/proto.c b/clamdscan/proto.c
index f37de07..b359d28 100644
--- a/clamdscan/proto.c
+++ b/clamdscan/proto.c
@@ -25,7 +25,9 @@
 /* must be first because it may define _XOPEN_SOURCE */
 #include "shared/fdpassing.h"
 #include <stdio.h>
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
+#endif
 #include <string.h>
 #include <errno.h>
 #include <stdlib.h>
@@ -33,11 +35,13 @@
 #include <sys/stat.h>
 #include <fcntl.h>
 #include <sys/types.h>
-#include <sys/socket.h>
 #ifdef HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif
+#ifndef _WIN32
 #include <arpa/inet.h>
+#include <sys/socket.h>
+#endif
 
 #include "libclamav/others.h"
 #include "shared/actions.h"
diff --git a/clamscan/clamscan.c b/clamscan/clamscan.c
index e4e69bd..91bac14 100644
--- a/clamscan/clamscan.c
+++ b/clamscan/clamscan.c
@@ -30,9 +30,7 @@
 #ifdef	HAVE_UNISTD_H
 #include <unistd.h>
 #endif
-#ifdef	C_WINDOWS
-#include <fcntl.h>
-#else
+#ifndef _WIN32
 #include <sys/time.h>
 #endif
 #include <time.h>
@@ -62,14 +60,14 @@ int main(int argc, char **argv)
 	int ds, dms, ret;
 	double mb, rmb;
 	struct timeval t1, t2;
-#ifndef C_WINDOWS
 	struct timezone tz;
+#ifndef _WIN32
 	sigset_t sigset;
 #endif
 	struct optstruct *opts;
 	const struct optstruct *opt;
 
-#if !defined(C_WINDOWS) && !defined(C_BEOS)
+#if !defined(_WIN32) && !defined(C_BEOS)
     sigemptyset(&sigset);
     sigaddset(&sigset, SIGXFSZ);
     sigprocmask(SIG_SETMASK, &sigset, NULL);
diff --git a/clamscan/manager.c b/clamscan/manager.c
index 11e31fd..612b008 100644
--- a/clamscan/manager.c
+++ b/clamscan/manager.c
@@ -29,14 +29,10 @@
 #include <ctype.h>
 #include <sys/stat.h>
 #include <sys/types.h>
-#ifdef C_WINDOWS
-#include <sys/utime.h>
-#else
+#include <dirent.h>
+#ifndef _WIN32
 #include <sys/wait.h>
 #include <utime.h>
-#endif
-#ifndef C_WINDOWS
-#include <dirent.h>
 #include <sys/time.h>
 #include <sys/resource.h>
 #endif
@@ -323,7 +319,7 @@ int scanmanager(const struct optstruct *opts)
 	char *file, cwd[1024], *pua_cats = NULL;
 	const char *filename;
 	const struct optstruct *opt;
-#ifndef C_WINDOWS
+#ifndef _WIN32
 	struct rlimit rlim;
 #endif
 
@@ -457,7 +453,7 @@ int scanmanager(const struct optstruct *opts)
 	}
     }
 
-#ifndef C_WINDOWS
+#ifndef _WIN32
     if(getrlimit(RLIMIT_FSIZE, &rlim) == 0) {
 	if(rlim.rlim_cur < (rlim_t) cl_engine_get_num(engine, CL_ENGINE_MAX_FILESIZE, NULL))
 	    logg("^System limit for file size is lower than engine->maxfilesize\n");
diff --git a/clamscan/others.c b/clamscan/others.c
index b662c81..5fb8c5e 100644
--- a/clamscan/others.c
+++ b/clamscan/others.c
@@ -36,7 +36,7 @@
 #endif
 #include <sys/types.h>
 #include <sys/stat.h>
-#ifndef C_WINDOWS
+#ifndef _WIN32
 #include <sys/wait.h>
 #include <sys/time.h>
 #endif
diff --git a/freshclam/execute.c b/freshclam/execute.c
index e1398c4..939f937 100644
--- a/freshclam/execute.c
+++ b/freshclam/execute.c
@@ -40,9 +40,6 @@ int active_children;
 void execute( const char *type, const char *text, const struct optstruct *opts )
 {
 	int ret;
-#ifndef C_WINDOWS
-	pid_t pid;
-#endif
 
     if(!optget(opts, "daemon")->enabled) {
 	if(sscanf(text, "EXIT_%d", &ret) == 1) {
@@ -65,7 +62,8 @@ void execute( const char *type, const char *text, const struct optstruct *opts )
 	} else
 		logg("^%s: already %d processes active.\n", type, active_children);
 #else
-	if ( active_children<MAX_CHILDREN )
+    if ( active_children<MAX_CHILDREN ) {
+	pid_t pid;
 	switch( pid=fork() ) {
 	case 0:
 		if ( -1==system(text) )
@@ -79,9 +77,8 @@ void execute( const char *type, const char *text, const struct optstruct *opts )
 	default:
 		active_children++;
 	}
-	else
-	{
+    } else {
 		logg("^%s: already %d processes active.\n", type, active_children);
-	}
+    }
 #endif
 }
diff --git a/freshclam/freshclam.c b/freshclam/freshclam.c
index 91b0a15..ad84036 100644
--- a/freshclam/freshclam.c
+++ b/freshclam/freshclam.c
@@ -30,7 +30,7 @@
 #include <signal.h>
 #include <time.h>
 #include <sys/types.h>
-#ifndef	C_WINDOWS
+#ifndef	_WIN32
 #include <sys/wait.h>
 #endif
 #include <sys/stat.h>
@@ -203,7 +203,7 @@ int main(int argc, char **argv)
 	struct sigaction sigact;
 	struct sigaction oldact;
 #endif
-#ifndef C_WINDOWS
+#ifdef HAVE_PWD_H
 	const char *dbowner;
 	struct passwd *user;
 #endif
@@ -256,7 +256,7 @@ int main(int argc, char **argv)
 #endif
     }
 
-#ifndef _WIN32
+#ifdef HAVE_PWD_H
     /* freshclam shouldn't work with root privileges */
     dbowner = optget(opts, "DatabaseOwner")->strarg;
 
@@ -419,7 +419,7 @@ int main(int argc, char **argv)
 
 	logg("#freshclam daemon %s (OS: "TARGET_OS_TYPE", ARCH: "TARGET_ARCH_TYPE", CPU: "TARGET_CPU_TYPE")\n", get_version());
 
-#ifdef	C_WINDOWS
+#ifdef _WIN32
 	signal(SIGINT, daemon_sighandler);
 	terminate = 0;
 #else
diff --git a/freshclam/manager.c b/freshclam/manager.c
index 3173961..f14edf9 100644
--- a/freshclam/manager.c
+++ b/freshclam/manager.c
@@ -43,16 +43,14 @@
 #include <strings.h>
 #endif
 #include <ctype.h>
-#ifndef C_WINDOWS
+#ifndef _WIN32
 #include <netinet/in.h>
 #include <netdb.h>
 #include <arpa/inet.h>
-#endif
-#include <sys/types.h>
-#ifndef C_WINDOWS
 #include <sys/socket.h>
 #include <sys/time.h>
 #endif
+#include <sys/types.h>
 #include <time.h>
 #include <fcntl.h>
 #include <sys/stat.h>
diff --git a/freshclam/mirman.c b/freshclam/mirman.c
index c971cfa..7326468 100644
--- a/freshclam/mirman.c
+++ b/freshclam/mirman.c
@@ -20,10 +20,6 @@
 #include "clamav-config.h"
 #endif
 
-#ifdef	C_WINDOWS
-#define	_USE_32BIT_TIME_T	/* FIXME: mirdat.atime assumes 32bit time_t */
-#endif
-
 #include <stdio.h>
 #include <string.h>
 #include <stdlib.h>
@@ -35,7 +31,7 @@
 #include <fcntl.h>
 #include <time.h>
 
-#ifndef C_WINDOWS
+#ifndef _WIN32
 #include <sys/socket.h>
 #include <netinet/in.h>
 #include <arpa/inet.h>
diff --git a/freshclam/nonblock.c b/freshclam/nonblock.c
index cf8e9d6..4aca47d 100644
--- a/freshclam/nonblock.c
+++ b/freshclam/nonblock.c
@@ -29,15 +29,13 @@
 #endif
 #include <string.h>
 #include <ctype.h>
-#ifndef	C_WINDOWS
+#ifndef	_WIN32
 #include <netinet/in.h>
 #include <netdb.h>
-#endif
-#include <sys/types.h>
-#ifndef	C_WINDOWS
 #include <sys/socket.h>
 #include <sys/time.h>
 #endif
+#include <sys/types.h>
 #include <time.h>
 #include <fcntl.h>
 #include <sys/stat.h>
@@ -46,16 +44,6 @@
 #include "shared/output.h"
 #include "libclamav/clamav.h"
 
-#if	(!defined(EALREADY)) && (defined(WSAEALREADY))
-#define EALREADY	WSAEALREADY
-#endif
-#if	(!defined(EINPROGRESS)) && (defined(WSAEINPROGRESS))
-#define EINPROGRESS	WSAEINPROGRESS
-#endif
-#if	(!defined(EISCONN)) && (defined(WSAEISCONN))
-#define EISCONN	WSAEISCONN
-#endif
-
 #ifdef SO_ERROR
 
 #ifndef timercmp
diff --git a/freshclam/nonblock.h b/freshclam/nonblock.h
index 3aaca68..0209b7a 100644
--- a/freshclam/nonblock.h
+++ b/freshclam/nonblock.h
@@ -24,7 +24,7 @@
 #endif
 
 #include <sys/types.h>
-#ifndef	C_WINDOWS
+#ifndef	_WIN32
 #include <sys/socket.h>
 #endif
 
diff --git a/freshclam/notify.c b/freshclam/notify.c
index d1d7690..8dfb005 100644
--- a/freshclam/notify.c
+++ b/freshclam/notify.c
@@ -43,7 +43,7 @@
 int notify(const char *cfgfile)
 {
 	char buff[20];
-#ifndef	C_WINDOWS
+#ifndef	_WIN32
 	struct sockaddr_un server;
 #endif
 #ifdef HAVE_GETADDRINFO
@@ -66,7 +66,7 @@ int notify(const char *cfgfile)
 	return 1;
     }
 
-#ifndef	C_WINDOWS
+#ifndef	_WIN32
     if((opt = optget(opts, "LocalSocket"))->enabled) {
 	socktype = "UNIX";
 	server.sun_family = AF_UNIX;
diff --git a/libclamav/binhex.c b/libclamav/binhex.c
index 52e280d..9584ac5 100644
--- a/libclamav/binhex.c
+++ b/libclamav/binhex.c
@@ -100,14 +100,6 @@ static	char	const	rcsid[] = "$Id: binhex.c,v 1.23 2007/02/12 20:46:08 njh Exp $"
 #endif
 #endif
 
-#ifdef	HAVE_MMAP
-#if HAVE_SYS_MMAN_H
-#include <sys/mman.h>
-#else /* HAVE_SYS_MMAN_H */
-#undef HAVE_MMAP
-#endif
-#endif
-
 #include <stdio.h>
 #include <memory.h>
 #include <sys/stat.h>
diff --git a/libclamav/chmunpack.c b/libclamav/chmunpack.c
index b234185..4494727 100644
--- a/libclamav/chmunpack.c
+++ b/libclamav/chmunpack.c
@@ -33,18 +33,6 @@
 #endif
 #include <string.h>
 
-#if defined(HAVE_ATTRIB_PACKED) || defined(HAVE_PRAGMA_PACK) || defined(HAVE_PRAGMA_PACK_HPPA)
-#if HAVE_MMAP
-#if HAVE_SYS_MMAN_H
-#include <sys/mman.h>
-#else /* HAVE_SYS_MMAN_H */
-#undef HAVE_MMAP
-#endif /* HAVE_SYS_MMAN_H */
-#endif /* HAVE_MMAP */
-#else/* PACKED */
-#undef HAVE_MMAP
-#endif
-
 #include "others.h"
 #include "mspack.h"
 #include "cltypes.h"
diff --git a/libclamav/htmlnorm.c b/libclamav/htmlnorm.c
index afbdff9..bc56c1b 100644
--- a/libclamav/htmlnorm.c
+++ b/libclamav/htmlnorm.c
@@ -40,14 +40,6 @@
 #include <stdio.h>
 #include <ctype.h>
 
-#if HAVE_MMAP
-#if HAVE_SYS_MMAN_H
-#include <sys/mman.h>
-#else /* HAVE_SYS_MMAN_H */
-#undef HAVE_MMAP
-#endif
-#endif
-
 #include "others.h"
 #include "htmlnorm.h"
 
diff --git a/libclamav/ishield.c b/libclamav/ishield.c
index 361e93a..9f3708e 100644
--- a/libclamav/ishield.c
+++ b/libclamav/ishield.c
@@ -32,11 +32,6 @@
 #ifdef	HAVE_UNISTD_H
 #include <unistd.h>
 #endif
-#if HAVE_MMAP
-#ifdef HAVE_SYS_MMAN_H
-#include <sys/mman.h>
-#endif
-#endif /* HAVE_MMAP */
 #if HAVE_STRING_H
 #include <string.h>
 #endif
diff --git a/libclamav/mbox.c b/libclamav/mbox.c
index 3f28cd6..ce768be 100644
--- a/libclamav/mbox.c
+++ b/libclamav/mbox.c
@@ -301,20 +301,8 @@ static	pthread_mutex_t	tables_mutex = PTHREAD_MUTEX_INITIALIZER;
 #endif
 
 #ifdef	NEW_WORLD
-
 #include "matcher.h"
-
 #undef	PARTIAL_DIR
-
-#if HAVE_MMAP
-#if HAVE_SYS_MMAN_H
-#include <sys/mman.h>
-#else /* HAVE_SYS_MMAN_H */
-#undef HAVE_MMAP
-#endif
-#else	/*HAVE_MMAP*/
-#undef	NEW_WORLD
-#endif
 #endif
 
 #ifdef	NEW_WORLD
diff --git a/libclamav/mpool.c b/libclamav/mpool.c
index 6603f99..7976562 100644
--- a/libclamav/mpool.c
+++ b/libclamav/mpool.c
@@ -35,7 +35,6 @@
 #if HAVE_STRING_H
 #include <string.h>
 #endif
-#include <sys/mman.h>
 #include <stddef.h>
 
 #include "others.h"
diff --git a/libclamav/nsis/nulsft.c b/libclamav/nsis/nulsft.c
index f3b73ee..ffa95ad 100644
--- a/libclamav/nsis/nulsft.c
+++ b/libclamav/nsis/nulsft.c
@@ -31,12 +31,6 @@
 #include <unistd.h>
 #endif
 
-#if HAVE_MMAP
-#ifdef HAVE_SYS_MMAN_H
-#include <sys/mman.h>
-#endif
-#endif
-
 #include "others.h"
 #include "cltypes.h"
 #include "nsis_bzlib.h"
diff --git a/libclamav/ole2_extract.c b/libclamav/ole2_extract.c
index 66c123a..510fab3 100644
--- a/libclamav/ole2_extract.c
+++ b/libclamav/ole2_extract.c
@@ -36,14 +36,6 @@
 #include <stdlib.h>
 #include "clamav.h"
 
-#if HAVE_MMAP
-#if HAVE_SYS_MMAN_H
-#include <sys/mman.h>
-#else /* HAVE_SYS_MMAN_H */
-#undef HAVE_MMAP
-#endif
-#endif
-
 #include "cltypes.h"
 #include "others.h"
 #include "ole2_extract.h"
diff --git a/libclamav/pdf.c b/libclamav/pdf.c
index e59316b..fa82218 100644
--- a/libclamav/pdf.c
+++ b/libclamav/pdf.c
@@ -42,16 +42,8 @@ static	char	const	rcsid[] = "$Id: pdf.c,v 1.61 2007/02/12 20:46:09 njh Exp $";
 #include <unistd.h>
 #endif
 
-#ifdef HAVE_SYS_MMAN_H
-#include <sys/mman.h>
-#endif
-
 #include <zlib.h>
 
-#ifdef	C_WINDOWS
-#include <io.h>
-#endif
-
 #include "clamav.h"
 #include "others.h"
 #include "mbox.h"
diff --git a/libclamav/scanners.c b/libclamav/scanners.c
index f6d3d23..492cd38 100644
--- a/libclamav/scanners.c
+++ b/libclamav/scanners.c
@@ -35,18 +35,7 @@
 #include <sys/param.h>
 #endif
 #include <fcntl.h>
-#ifndef	C_WINDOWS
 #include <dirent.h>
-#include <netinet/in.h>
-#endif
-
-#if HAVE_MMAP
-#if HAVE_SYS_MMAN_H
-#include <sys/mman.h>
-#else /* HAVE_SYS_MMAN_H */
-#undef HAVE_MMAP
-#endif
-#endif
 
 #define DCONF_ARCH  ctx->dconf->archive
 #define DCONF_DOC   ctx->dconf->doc
diff --git a/libclamav/special.c b/libclamav/special.c
index e50b9cd..19a6ce3 100644
--- a/libclamav/special.c
+++ b/libclamav/special.c
@@ -28,9 +28,6 @@
 #ifdef	HAVE_UNISTD_H
 #include <unistd.h>
 #endif
-#ifndef	C_WINDOWS
-#include <netinet/in.h>
-#endif
 #include <string.h>
 #include <ctype.h>
 #include "clamav.h"
diff --git a/libclamav/unzip.c b/libclamav/unzip.c
index 5dbe1df..03ab4f4 100644
--- a/libclamav/unzip.c
+++ b/libclamav/unzip.c
@@ -34,13 +34,6 @@
 #include <string.h>
 #endif
 #include <stdlib.h>
-
-#if HAVE_MMAP
-#ifdef HAVE_SYS_MMAN_H
-#include <sys/mman.h>
-#endif
-#endif /* HAVE_MMAP */
-
 #include <stdio.h>
 
 #include <zlib.h>
diff --git a/platform.h.in b/platform.h.in
index ea2b482..0c70621 100644
--- a/platform.h.in
+++ b/platform.h.in
@@ -34,3 +34,6 @@ typedef	unsigned	int	in_addr_t;
 #define PATHSEP "/"
 #endif
 
+#if defined(HAVE_MMAP) && defined(HAVE_SYS_MMAN_H)
+#include <sys/mman.h>
+#endif
diff --git a/shared/actions.c b/shared/actions.c
index 044751d..94ac195 100644
--- a/shared/actions.c
+++ b/shared/actions.c
@@ -30,7 +30,6 @@
 #include <unistd.h>
 #endif
 #include <fcntl.h>
-#include <utime.h>
 #include <errno.h>
 #include <libgen.h>
 
diff --git a/shared/misc.c b/shared/misc.c
index 60d691e..40e6496 100644
--- a/shared/misc.c
+++ b/shared/misc.c
@@ -31,7 +31,9 @@
 #include <time.h>
 #include <sys/types.h>
 #include <sys/stat.h>
+#ifndef _WIN32
 #include <sys/socket.h>
+#endif
 #include <dirent.h>
 #include <fcntl.h>
 #include <ctype.h>
diff --git a/shared/misc.h b/shared/misc.h
index 2cf6df2..7ceabe7 100644
--- a/shared/misc.h
+++ b/shared/misc.h
@@ -20,8 +20,10 @@
 
 #ifndef __MISC_H
 #define __MISC_H
+#ifndef _WIN32
 #include <netdb.h>
 #include <netinet/in.h>
+#endif
 #include "optparser.h"
 /* Maximum filenames under various systems - njh */
 #ifndef	NAME_MAX	/* e.g. Linux */
diff --git a/shared/output.c b/shared/output.c
index edf29c6..02ce0ca 100644
--- a/shared/output.c
+++ b/shared/output.c
@@ -34,7 +34,7 @@
 #include <time.h>
 #include <sys/stat.h>
 #include <errno.h>
-#ifndef C_WINDOWS
+#ifndef _WIN32
 #include <sys/time.h>
 #include <sys/socket.h>
 #endif
diff --git a/sigtool/sigtool.c b/sigtool/sigtool.c
index bc61785..66b4d3b 100644
--- a/sigtool/sigtool.c
+++ b/sigtool/sigtool.c
@@ -39,8 +39,8 @@
 #include <sys/un.h>
 #include <netinet/in.h>
 #include <arpa/inet.h>
-#endif
 #include <sys/wait.h>
+#endif
 #include <dirent.h>
 
 #ifdef HAVE_TERMIOS_H

-- 
Debian repository for ClamAV



More information about the Pkg-clamav-commits mailing list