git-svn: trunk@4143
Tomasz Kojm authored on 2008/08/26 06:59:33... | ... |
@@ -5114,7 +5114,7 @@ qfile(struct privdata *privdata, const char *sendmailId, const char *virusname) |
5114 | 5114 |
#ifdef C_DARWIN |
5115 | 5115 |
*ptr &= '\177'; |
5116 | 5116 |
#endif |
5117 |
-#if defined(MSDOS) || defined(C_CYGWIN) || defined(C_WINDOWS) || defined(C_OS2) |
|
5117 |
+#if defined(MSDOS) || defined(C_WINDOWS) || defined(C_OS2) |
|
5118 | 5118 |
if(strchr("/*?<>|\\\"+=,;:\t ", *ptr)) |
5119 | 5119 |
#else |
5120 | 5120 |
if(*ptr == '/') |
... | ... |
@@ -157,7 +157,7 @@ static int dirscan(const char *dirname, const char **virname, unsigned long int |
157 | 157 |
return 1; |
158 | 158 |
} |
159 | 159 |
|
160 |
-#if (!defined(C_INTERIX)) && (!defined(C_WINDOWS)) && (!defined(C_CYGWIN)) |
|
160 |
+#if (!defined(C_INTERIX)) && (!defined(C_WINDOWS)) |
|
161 | 161 |
if(dent->d_ino) |
162 | 162 |
#endif |
163 | 163 |
{ |
... | ... |
@@ -249,15 +249,11 @@ static char *abpath(const char *filename) |
249 | 249 |
return NULL; |
250 | 250 |
} else { |
251 | 251 |
fullpath = malloc(PATH_MAX + strlen(filename) + 10); |
252 |
-#ifdef C_CYGWIN |
|
253 |
- sprintf(fullpath, "%s", filename); |
|
254 |
-#else |
|
255 | 252 |
if(!getcwd(cwd, PATH_MAX)) { |
256 | 253 |
logg("^Can't get absolute pathname of current working directory.\n"); |
257 | 254 |
return NULL; |
258 | 255 |
} |
259 | 256 |
sprintf(fullpath, "%s/%s", cwd, filename); |
260 |
-#endif |
|
261 | 257 |
} |
262 | 258 |
|
263 | 259 |
return fullpath; |
... | ... |
@@ -235,7 +235,7 @@ static int scandirs(const char *dirname, struct cl_engine *engine, const struct |
235 | 235 |
|
236 | 236 |
if((dd = opendir(dirname)) != NULL) { |
237 | 237 |
while((dent = readdir(dd))) { |
238 |
-#if !defined(C_INTERIX) && !defined(C_WINDOWS) && !defined(C_CYGWIN) |
|
238 |
+#if !defined(C_INTERIX) && !defined(C_WINDOWS) |
|
239 | 239 |
if(dent->d_ino) |
240 | 240 |
#endif |
241 | 241 |
{ |
... | ... |
@@ -16819,33 +16819,6 @@ _ACEOF |
16819 | 16819 |
fi |
16820 | 16820 |
fi |
16821 | 16821 |
;; |
16822 |
-cygwin*) |
|
16823 |
- |
|
16824 |
-cat >>confdefs.h <<\_ACEOF |
|
16825 |
-#define C_CYGWIN 1 |
|
16826 |
-_ACEOF |
|
16827 |
- |
|
16828 |
- if test "$test_clamav" = "yes"; then |
|
16829 |
- if test ! -r /etc/passwd; then |
|
16830 |
- test_clamav="no" |
|
16831 |
- fi |
|
16832 |
- fi |
|
16833 |
- if test "$have_pthreads" = "yes"; then |
|
16834 |
- THREAD_LIBS="-lpthread" |
|
16835 |
- TH_SAFE="-thread-safe" |
|
16836 |
- |
|
16837 |
-cat >>confdefs.h <<\_ACEOF |
|
16838 |
-#define CL_THREAD_SAFE 1 |
|
16839 |
-_ACEOF |
|
16840 |
- |
|
16841 |
- |
|
16842 |
-cat >>confdefs.h <<\_ACEOF |
|
16843 |
-#define _REENTRANT 1 |
|
16844 |
-_ACEOF |
|
16845 |
- |
|
16846 |
- fi |
|
16847 |
- use_gethostbyname_r="no" |
|
16848 |
- ;; |
|
16849 | 16822 |
solaris*) |
16850 | 16823 |
FRESHCLAM_LIBS="$FRESHCLAM_LIBS -lresolv" |
16851 | 16824 |
if test "$have_pthreads" = "yes"; then |
... | ... |
@@ -756,21 +756,6 @@ kfreebsd*-gnu) |
756 | 756 |
fi |
757 | 757 |
fi |
758 | 758 |
;; |
759 |
-cygwin*) |
|
760 |
- AC_DEFINE([C_CYGWIN],1,[os is cygwin]) |
|
761 |
- if test "$test_clamav" = "yes"; then |
|
762 |
- if test ! -r /etc/passwd; then |
|
763 |
- test_clamav="no" |
|
764 |
- fi |
|
765 |
- fi |
|
766 |
- if test "$have_pthreads" = "yes"; then |
|
767 |
- THREAD_LIBS="-lpthread" |
|
768 |
- TH_SAFE="-thread-safe" |
|
769 |
- AC_DEFINE([CL_THREAD_SAFE],1,[thread safe]) |
|
770 |
- AC_DEFINE([_REENTRANT],1,[thread safe]) |
|
771 |
- fi |
|
772 |
- use_gethostbyname_r="no" |
|
773 |
- ;; |
|
774 | 759 |
solaris*) |
775 | 760 |
FRESHCLAM_LIBS="$FRESHCLAM_LIBS -lresolv" |
776 | 761 |
if test "$have_pthreads" = "yes"; then |
... | ... |
@@ -200,7 +200,7 @@ int main(int argc, char **argv) |
200 | 200 |
struct sigaction sigact; |
201 | 201 |
struct sigaction oldact; |
202 | 202 |
#endif |
203 |
-#if !defined(C_CYGWIN) && !defined(C_OS2) && !defined(C_WINDOWS) |
|
203 |
+#if !defined(C_OS2) && !defined(C_WINDOWS) |
|
204 | 204 |
char *unpuser; |
205 | 205 |
struct passwd *user; |
206 | 206 |
#endif |
... | ... |
@@ -296,7 +296,7 @@ int main(int argc, char **argv) |
296 | 296 |
return 56; |
297 | 297 |
} |
298 | 298 |
|
299 |
-#if !defined(C_CYGWIN) && !defined(C_WINDOWS) |
|
299 |
+#ifndef C_WINDOWS |
|
300 | 300 |
if(statbuf.st_mode & (S_IRGRP | S_IWGRP | S_IXGRP | S_IROTH | S_IWOTH | S_IXOTH)) { |
301 | 301 |
logg("^Insecure permissions (for HTTPProxyPassword): %s must have no more than 0700 permissions.\n", cfgfile); |
302 | 302 |
opt_free(opt); |
... | ... |
@@ -306,7 +306,7 @@ int main(int argc, char **argv) |
306 | 306 |
#endif |
307 | 307 |
} |
308 | 308 |
|
309 |
-#if !defined(C_CYGWIN) && !defined(C_OS2) && !defined(C_WINDOWS) |
|
309 |
+#if !defined(C_OS2) && !defined(C_WINDOWS) |
|
310 | 310 |
/* freshclam shouldn't work with root privileges */ |
311 | 311 |
if(opt_check(opt, "user")) |
312 | 312 |
unpuser = opt_arg(opt, "user"); |
... | ... |
@@ -212,7 +212,6 @@ static int wwwconnect(const char *server, const char *proxy, int pport, char *ip |
212 | 212 |
hostpt = proxy; |
213 | 213 |
|
214 | 214 |
if(!(port = pport)) { |
215 |
-#ifndef C_CYGWIN |
|
216 | 215 |
const struct servent *webcache = getservbyname("webcache", "TCP"); |
217 | 216 |
|
218 | 217 |
if(webcache) |
... | ... |
@@ -223,9 +222,6 @@ static int wwwconnect(const char *server, const char *proxy, int pport, char *ip |
223 | 223 |
#ifndef C_WINDOWS |
224 | 224 |
endservent(); |
225 | 225 |
#endif |
226 |
-#else |
|
227 |
- port = 8080; |
|
228 |
-#endif |
|
229 | 226 |
} |
230 | 227 |
|
231 | 228 |
} else { |
... | ... |
@@ -699,7 +699,7 @@ sanitiseName(char *name) |
699 | 699 |
* I don't know if spaces are legal in OS/2. |
700 | 700 |
*/ |
701 | 701 |
if(strchr("%/*?<>|\\\"+=,;:\t ~", *name)) |
702 |
-#elif defined(C_CYGWIN) || defined(C_WINDOWS) |
|
702 |
+#elif defined(C_WINDOWS) |
|
703 | 703 |
if(strchr("%/*?<>|\\\"+=,;:\t~", *name)) |
704 | 704 |
#else |
705 | 705 |
if(*name == '/') |
... | ... |
@@ -87,7 +87,7 @@ static char const rcsid[] = "$Id: mbox.c,v 1.381 2007/02/15 12:26:44 njh Exp $"; |
87 | 87 |
|
88 | 88 |
#ifdef CL_DEBUG |
89 | 89 |
|
90 |
-#if defined(C_LINUX) || defined(C_CYGWIN) |
|
90 |
+#if defined(C_LINUX) |
|
91 | 91 |
#include <features.h> |
92 | 92 |
#endif |
93 | 93 |
|
... | ... |
@@ -3715,12 +3715,14 @@ rfc1341(message *m, const char *dir) |
3715 | 3715 |
if(id == NULL) |
3716 | 3716 |
return -1; |
3717 | 3717 |
|
3718 |
+/* do we need this for C_WINDOWS? |
|
3718 | 3719 |
#ifdef C_CYGWIN |
3719 | 3720 |
if((tmpdir = getenv("TEMP")) == (char *)NULL) |
3720 | 3721 |
if((tmpdir = getenv("TMP")) == (char *)NULL) |
3721 | 3722 |
if((tmpdir = getenv("TMPDIR")) == (char *)NULL) |
3722 | 3723 |
tmpdir = "C:\\"; |
3723 | 3724 |
#else |
3725 |
+*/ |
|
3724 | 3726 |
if((tmpdir = getenv("TMPDIR")) == (char *)NULL) |
3725 | 3727 |
if((tmpdir = getenv("TMP")) == (char *)NULL) |
3726 | 3728 |
if((tmpdir = getenv("TEMP")) == (char *)NULL) |
... | ... |
@@ -3729,7 +3731,6 @@ rfc1341(message *m, const char *dir) |
3729 | 3729 |
#else |
3730 | 3730 |
tmpdir = "/tmp"; |
3731 | 3731 |
#endif |
3732 |
-#endif |
|
3733 | 3732 |
|
3734 | 3733 |
snprintf(pdir, sizeof(pdir) - 1, "%s/clamav-partial", tmpdir); |
3735 | 3734 |
|
... | ... |
@@ -3853,7 +3854,7 @@ rfc1341(message *m, const char *dir) |
3853 | 3853 |
int nblanks; |
3854 | 3854 |
struct stat statb; |
3855 | 3855 |
const char *dentry_idpart; |
3856 |
-#if !defined (C_CYGWIN) && !defined(C_WINDOWS) |
|
3856 |
+#ifndef C_WINDOWS |
|
3857 | 3857 |
if(dent->d_ino == 0) |
3858 | 3858 |
continue; |
3859 | 3859 |
#endif |
... | ... |
@@ -672,7 +672,7 @@ int cli_rmdirs(const char *dirname) |
672 | 672 |
#else |
673 | 673 |
while((dent = readdir(dd))) { |
674 | 674 |
#endif |
675 |
-#if (!defined(C_CYGWIN)) && (!defined(C_INTERIX)) && (!defined(C_WINDOWS)) |
|
675 |
+#if (!defined(C_INTERIX)) && (!defined(C_WINDOWS)) |
|
676 | 676 |
if(dent->d_ino) |
677 | 677 |
#endif |
678 | 678 |
{ |
... | ... |
@@ -1822,7 +1822,7 @@ static int cli_loaddbdir(const char *dirname, struct cl_engine **engine, unsigne |
1822 | 1822 |
#else |
1823 | 1823 |
while((dent = readdir(dd))) { |
1824 | 1824 |
#endif |
1825 |
-#if (!defined(C_INTERIX)) && (!defined(C_WINDOWS)) && (!defined(C_CYGWIN)) |
|
1825 |
+#if (!defined(C_INTERIX)) && (!defined(C_WINDOWS)) |
|
1826 | 1826 |
if(dent->d_ino) |
1827 | 1827 |
#endif |
1828 | 1828 |
{ |
... | ... |
@@ -1938,7 +1938,7 @@ int cl_statinidir(const char *dirname, struct cl_stat *dbstat) |
1938 | 1938 |
#else |
1939 | 1939 |
while((dent = readdir(dd))) { |
1940 | 1940 |
#endif |
1941 |
-#if (!defined(C_INTERIX)) && (!defined(C_WINDOWS)) && (!defined(C_CYGWIN)) |
|
1941 |
+#if (!defined(C_INTERIX)) && (!defined(C_WINDOWS)) |
|
1942 | 1942 |
if(dent->d_ino) |
1943 | 1943 |
#endif |
1944 | 1944 |
{ |
... | ... |
@@ -2021,7 +2021,7 @@ int cl_statchkdir(const struct cl_stat *dbstat) |
2021 | 2021 |
#else |
2022 | 2022 |
while((dent = readdir(dd))) { |
2023 | 2023 |
#endif |
2024 |
-#if (!defined(C_INTERIX)) && (!defined(C_WINDOWS)) && (!defined(C_CYGWIN)) |
|
2024 |
+#if (!defined(C_INTERIX)) && (!defined(C_WINDOWS)) |
|
2025 | 2025 |
if(dent->d_ino) |
2026 | 2026 |
#endif |
2027 | 2027 |
{ |
... | ... |
@@ -131,7 +131,7 @@ static int cli_scandir(const char *dirname, cli_ctx *ctx, cli_file_t container) |
131 | 131 |
#else |
132 | 132 |
while((dent = readdir(dd))) { |
133 | 133 |
#endif |
134 |
-#if (!defined(C_CYGWIN)) && (!defined(C_INTERIX)) && (!defined(C_WINDOWS)) |
|
134 |
+#if (!defined(C_INTERIX)) && (!defined(C_WINDOWS)) |
|
135 | 135 |
if(dent->d_ino) |
136 | 136 |
#endif |
137 | 137 |
{ |
... | ... |
@@ -894,7 +894,7 @@ static int cli_vba_scandir(const char *dirname, cli_ctx *ctx, struct uniq *U) |
894 | 894 |
#else |
895 | 895 |
while((dent = readdir(dd))) { |
896 | 896 |
#endif |
897 |
-#if (!defined(C_CYGWIN)) && (!defined(C_INTERIX)) && (!defined(C_WINDOWS)) |
|
897 |
+#if (!defined(C_INTERIX)) && (!defined(C_WINDOWS)) |
|
898 | 898 |
if(dent->d_ino) |
899 | 899 |
#endif |
900 | 900 |
{ |
... | ... |
@@ -239,7 +239,7 @@ int dircopy(const char *src, const char *dest) |
239 | 239 |
} |
240 | 240 |
|
241 | 241 |
while((dent = readdir(dd))) { |
242 |
-#if (!defined(C_CYGWIN)) && (!defined(C_INTERIX)) && (!defined(C_WINDOWS)) |
|
242 |
+#if (!defined(C_INTERIX)) && (!defined(C_WINDOWS)) |
|
243 | 243 |
if(dent->d_ino) |
244 | 244 |
#endif |
245 | 245 |
{ |
... | ... |
@@ -341,7 +341,7 @@ int match_regex(const char *filename, const char *pattern) |
341 | 341 |
regex_t reg; |
342 | 342 |
int match, flags = REG_EXTENDED | REG_NOSUB; |
343 | 343 |
char fname[513]; |
344 |
-#if defined(C_CYGWIN) || defined(C_OS2) || defined(C_WINDOWS) |
|
344 |
+#if defined(C_OS2) || defined(C_WINDOWS) |
|
345 | 345 |
size_t len; |
346 | 346 |
|
347 | 347 |
flags |= REG_ICASE; /* case insensitive on Windows */ |
... | ... |
@@ -349,7 +349,7 @@ int match_regex(const char *filename, const char *pattern) |
349 | 349 |
if(cli_regcomp(®, pattern, flags) != 0) |
350 | 350 |
return 2; |
351 | 351 |
|
352 |
-#if !defined(C_CYGWIN) && !defined(C_OS2) && !defined(C_WINDOWS) |
|
352 |
+#if !defined(C_OS2) && !defined(C_WINDOWS) |
|
353 | 353 |
if(pattern[strlen(pattern) - 1] == '/') { |
354 | 354 |
snprintf(fname, 511, "%s/", filename); |
355 | 355 |
fname[512] = 0; |