git-svn-id: file:///var/lib/svn/clamav-devel/trunk/clamav-devel@1093 77e5149b-7576-45b1-b177-96237e5ba77b
Tomasz Kojm authored on 2004/11/13 23:47:20... | ... |
@@ -1,3 +1,8 @@ |
1 |
+Sat Nov 13 15:45:38 CET 2004 (tk) |
|
2 |
+--------------------------------- |
|
3 |
+ * libclamav, clamd: readdir_r code: fix compilation error on systems that |
|
4 |
+ don't define NAME_MAX |
|
5 |
+ |
|
1 | 6 |
Sat Nov 13 14:26:21 CET 2004 (tk) |
2 | 7 |
--------------------------------- |
3 | 8 |
* docs/MacOSX: update (Dale Enterprise L.L.C) |
... | ... |
@@ -28,6 +28,7 @@ |
28 | 28 |
#include <sys/types.h> |
29 | 29 |
#include <sys/time.h> |
30 | 30 |
#include <sys/wait.h> |
31 |
+#include <sys/param.h> |
|
31 | 32 |
#include <dirent.h> |
32 | 33 |
#include <sys/socket.h> |
33 | 34 |
#include <netinet/in.h> |
... | ... |
@@ -55,6 +56,17 @@ |
55 | 55 |
dev_t procdev; /* /proc device */ |
56 | 56 |
#endif |
57 | 57 |
|
58 |
+/* Maximum filenames under various systems - njh */ |
|
59 |
+#ifndef NAME_MAX /* e.g. Linux */ |
|
60 |
+# ifdef MAXNAMELEN /* e.g. Solaris */ |
|
61 |
+# define NAME_MAX MAXNAMELEN |
|
62 |
+# else |
|
63 |
+# ifdef FILENAME_MAX /* e.g. SCO */ |
|
64 |
+# define NAME_MAX FILENAME_MAX |
|
65 |
+# endif |
|
66 |
+# endif |
|
67 |
+#endif |
|
68 |
+ |
|
58 | 69 |
pthread_mutex_t gh_mutex = PTHREAD_MUTEX_INITIALIZER; |
59 | 70 |
|
60 | 71 |
int checksymlink(const char *path) |
... | ... |
@@ -38,6 +38,7 @@ |
38 | 38 |
#include <errno.h> |
39 | 39 |
#include <target.h> |
40 | 40 |
#include <sys/time.h> |
41 |
+#include <sys/param.h> |
|
41 | 42 |
|
42 | 43 |
#ifdef CL_THREAD_SAFE |
43 | 44 |
# include <pthread.h> |
... | ... |
@@ -54,6 +55,17 @@ pthread_mutex_t cli_gentemp_mutex = PTHREAD_MUTEX_INITIALIZER; |
54 | 54 |
#include "md5.h" |
55 | 55 |
#include "cltypes.h" |
56 | 56 |
|
57 |
+/* Maximum filenames under various systems - njh */ |
|
58 |
+#ifndef NAME_MAX /* e.g. Linux */ |
|
59 |
+# ifdef MAXNAMELEN /* e.g. Solaris */ |
|
60 |
+# define NAME_MAX MAXNAMELEN |
|
61 |
+# else |
|
62 |
+# ifdef FILENAME_MAX /* e.g. SCO */ |
|
63 |
+# define NAME_MAX FILENAME_MAX |
|
64 |
+# endif |
|
65 |
+# endif |
|
66 |
+#endif |
|
67 |
+ |
|
57 | 68 |
#define CL_FLEVEL 3 /* don't touch it */ |
58 | 69 |
|
59 | 70 |
#define MAX_ALLOCATION 134217728 |
... | ... |
@@ -28,6 +28,7 @@ |
28 | 28 |
#include <dirent.h> |
29 | 29 |
#include <sys/types.h> |
30 | 30 |
#include <sys/stat.h> |
31 |
+#include <sys/param.h> |
|
31 | 32 |
#include <fcntl.h> |
32 | 33 |
|
33 | 34 |
#include "clamav.h" |
... | ... |
@@ -44,6 +45,17 @@ |
44 | 44 |
#include <stddef.h> |
45 | 45 |
#endif |
46 | 46 |
|
47 |
+/* Maximum filenames under various systems - njh */ |
|
48 |
+#ifndef NAME_MAX /* e.g. Linux */ |
|
49 |
+# ifdef MAXNAMELEN /* e.g. Solaris */ |
|
50 |
+# define NAME_MAX MAXNAMELEN |
|
51 |
+# else |
|
52 |
+# ifdef FILENAME_MAX /* e.g. SCO */ |
|
53 |
+# define NAME_MAX FILENAME_MAX |
|
54 |
+# endif |
|
55 |
+# endif |
|
56 |
+#endif |
|
57 |
+ |
|
47 | 58 |
/* TODO: clean up the code */ |
48 | 59 |
|
49 | 60 |
static int cli_ac_addsig(struct cl_node *root, const char *virname, const char *hexsig, int sigid, int parts, int partno, unsigned short type, unsigned int mindist, unsigned int maxdist, char *offset, unsigned short target) |
... | ... |
@@ -26,6 +26,7 @@ |
26 | 26 |
#include <unistd.h> |
27 | 27 |
#include <sys/types.h> |
28 | 28 |
#include <sys/stat.h> |
29 |
+#include <sys/param.h> |
|
29 | 30 |
#include <fcntl.h> |
30 | 31 |
#include <dirent.h> |
31 | 32 |
#include <netinet/in.h> |
... | ... |
@@ -82,6 +83,16 @@ extern int cli_mbox(const char *dir, int desc, unsigned int options); /* FIXME * |
82 | 82 |
#include <stddef.h> |
83 | 83 |
#endif |
84 | 84 |
|
85 |
+/* Maximum filenames under various systems - njh */ |
|
86 |
+#ifndef NAME_MAX /* e.g. Linux */ |
|
87 |
+# ifdef MAXNAMELEN /* e.g. Solaris */ |
|
88 |
+# define NAME_MAX MAXNAMELEN |
|
89 |
+# else |
|
90 |
+# ifdef FILENAME_MAX /* e.g. SCO */ |
|
91 |
+# define NAME_MAX FILENAME_MAX |
|
92 |
+# endif |
|
93 |
+# endif |
|
94 |
+#endif |
|
85 | 95 |
|
86 | 96 |
#define SCAN_ARCHIVE (options & CL_SCAN_ARCHIVE) |
87 | 97 |
#define SCAN_MAIL (options & CL_SCAN_MAIL) |