Browse code

don't use EXIT_SUCCESS if <stdlib.h> is not included; include <sys/select.h> only if needed for fd_set (bb #452)

git-svn: trunk@3604

Török Edvin authored on 2008/02/10 17:44:14
Showing 3 changed files
... ...
@@ -1,3 +1,10 @@
1
+Sun Feb 10 10:28:55 EET 2008 (edwin)
2
+------------------------------------
3
+  * configure, configure.in: don't use EXIT_SUCCESS if <stdlib.h> is not
4
+			     included;
5
+			     include <sys/select.h> only if needed for fd_set
6
+			     (bb #452)
7
+			     
1 8
 Fri Feb  8 20:16:45 CET 2008 (tk)
2 9
 ---------------------------------
3 10
   * libclamac/readdb.c: add support for signature whitelisting with
... ...
@@ -18233,8 +18233,12 @@ cat >>conftest.$ac_ext <<_ACEOF
18233 18233
 #include <stdio.h>
18234 18234
 #include <unistd.h>
18235 18235
 #include <sys/time.h>
18236
+#ifdef HAVE_SYS_SELECT_H
18236 18237
 #include <sys/select.h>
18238
+#endif
18239
+#ifdef HAVE_SYS_TYPES_H
18237 18240
 #include <sys/types.h>
18241
+#endif
18238 18242
 #include <errno.h>
18239 18243
 int main(void) {
18240 18244
         FILE *fp = fopen("conftestval", "w");
... ...
@@ -18247,7 +18251,7 @@ int main(void) {
18247 18247
 		perror("fopen failed");
18248 18248
 		return errno;
18249 18249
 	}
18250
-        return EXIT_SUCCESS;
18250
+        return 0;
18251 18251
 }
18252 18252
 
18253 18253
 _ACEOF
... ...
@@ -1349,8 +1349,12 @@ AC_TRY_RUN([
1349 1349
 #include <stdio.h>
1350 1350
 #include <unistd.h>
1351 1351
 #include <sys/time.h>
1352
+#ifdef HAVE_SYS_SELECT_H
1352 1353
 #include <sys/select.h>
1354
+#endif
1355
+#ifdef HAVE_SYS_TYPES_H
1353 1356
 #include <sys/types.h>
1357
+#endif
1354 1358
 #include <errno.h>
1355 1359
 int main(void) {
1356 1360
         FILE *fp = fopen("conftestval", "w");
... ...
@@ -1363,7 +1367,7 @@ int main(void) {
1363 1363
 		perror("fopen failed");
1364 1364
 		return errno;
1365 1365
 	}
1366
-        return EXIT_SUCCESS;
1366
+        return 0;
1367 1367
 }
1368 1368
 ],
1369 1369
 DEFAULT_FD_SETSIZE=`cat conftestval`,