Browse code

fix Solaris build

git-svn: trunk@4776

Török Edvin authored on 2009/02/13 20:05:14
Showing 9 changed files
... ...
@@ -1,3 +1,7 @@
1
+Fri Feb 13 13:34:21 EET 2009 (edwin)
2
+------------------------------------
3
+ * clamav-milter/, clamd/, clamdscan/, shared/: fix Solaris build
4
+
1 5
 Fri Feb 13 11:11:03 EET 2009 (edwin)
2 6
 ------------------------------------
3 7
  * clamd/others.c, clamd/session.c: fdpassing is now in others.c
... ...
@@ -22,6 +22,8 @@
22 22
 #include "clamav-config.h"
23 23
 #endif
24 24
 
25
+/* must be first because it may define _XOPEN_SOURCE */
26
+#include "shared/fdpassing.h"
25 27
 #include <stdio.h>
26 28
 #include <string.h>
27 29
 #include <stdlib.h>
... ...
@@ -26,11 +26,8 @@
26 26
 #include "clamav-config.h"
27 27
 #endif
28 28
 
29
-#if defined HAVE_FD_PASSING && defined FDPASS_NEED_XOPEN
30
-/* to expose BSD 4.4/Unix98 semantics instead of BSD 4.3 semantics */
31
-#define _XOPEN_SOURCE 500
32
-#endif
33
-
29
+/* must be first because it may define _XOPEN_SOURCE */
30
+#include "shared/fdpassing.h"
34 31
 #include <stdio.h>
35 32
 #include <stdarg.h>
36 33
 #include <stdlib.h>
... ...
@@ -87,10 +84,7 @@
87 87
 
88 88
 #include "session.h"
89 89
 #include "others.h"
90
-
91
-#ifndef PATH_MAX
92
-#define PATH_MAX 1024
93
-#endif
90
+#include "misc.h"
94 91
 
95 92
 #ifdef	C_WINDOWS
96 93
 void virusaction(const char *filename, const char *virname, const struct optstruct *opts)
... ...
@@ -84,7 +84,7 @@ int tcpserver(const struct optstruct *opts)
84 84
 	closesocket(sockfd);
85 85
 	return -1;
86 86
     } else {
87
-	const struct optstruct *taddr = optget(opts, "TCPSocket");
87
+	const struct optstruct *taddr = optget(opts, "TCPAddr");
88 88
 	if(taddr->enabled)
89 89
 	    logg("#TCP: Bound to address %s on port %u\n", taddr->strarg, optget(opts, "TCPSocket")->numarg);
90 90
 	else
... ...
@@ -62,10 +62,6 @@
62 62
 #define INADDR_LOOPBACK 0x7f000001
63 63
 #endif
64 64
 
65
-#ifndef PATH_MAX
66
-#define PATH_MAX 1024
67
-#endif
68
-
69 65
 struct sockaddr *mainsa = NULL;
70 66
 int mainsasz;
71 67
 unsigned long int maxstream;
... ...
@@ -18,6 +18,12 @@
18 18
  *  MA 02110-1301, USA.
19 19
  */
20 20
 
21
+#if HAVE_CONFIG_H
22
+#include "clamav-config.h"
23
+#endif
24
+
25
+/* must be first because it may define _XOPEN_SOURCE */
26
+#include "shared/fdpassing.h"
21 27
 #include <stdio.h>
22 28
 #include <unistd.h>
23 29
 #include <string.h>
... ...
@@ -20,6 +20,8 @@
20 20
 
21 21
 #ifndef PROTO_H
22 22
 #define PROTO_H
23
+#include "shared/misc.h"
24
+
23 25
 struct RCVLN {
24 26
     char buf[PATH_MAX+1024]; /* FIXME must match that in clamd - bb1349 */
25 27
     int sockd;
26 28
new file mode 100644
... ...
@@ -0,0 +1,18 @@
0
+#ifndef FDPASSING_H
1
+#define FDPASSING_H
2
+
3
+#ifdef HAVE_FD_PASSING
4
+
5
+#ifdef FDPASS_NEED_XOPEN
6
+/* to expose BSD 4.4/Unix98 semantics instead of BSD 4.3 semantics */
7
+#define _XOPEN_SOURCE 500
8
+#endif
9
+
10
+#include <sys/types.h>
11
+#include <sys/socket.h>
12
+#include <sys/un.h>
13
+#include <sys/uio.h>
14
+
15
+#endif
16
+#endif
17
+
... ...
@@ -34,6 +34,12 @@
34 34
 # endif
35 35
 #endif
36 36
 
37
+#include <limits.h>
38
+
39
+#ifndef PATH_MAX
40
+#define PATH_MAX 1024
41
+#endif
42
+
37 43
 char *freshdbdir(void);
38 44
 void print_version(const char *dbdir);
39 45
 int filecopy(const char *src, const char *dest);