Browse code

make milter compile even without resolv.h - bb#1125

git-svn: trunk@4085

aCaB authored on 2008/08/05 19:58:39
Showing 2 changed files
... ...
@@ -1,3 +1,7 @@
1
+Tue Aug  5 12:43:27 CEST 2008 (acab)
2
+------------------------------------
3
+  * clamav-milter: properly wrap dns stuff - bb#1125
4
+
1 5
 Mon Aug  4 22:07:54 CEST 2008 (tk)
2 6
 ----------------------------------
3 7
   * libclamav/ole2_extract: don't return CL_BREAK in cli_ole2_extract()
... ...
@@ -590,13 +590,13 @@ static	int	useful_header(const char *cmd);
590 590
 
591 591
 extern	short	logg_foreground;
592 592
 
593
-
593
+#if HAVE_RESOLV_H
594 594
 res_state res_pool;
595 595
 uint8_t *res_pool_state;
596
-
597 596
 pthread_cond_t res_pool_cond = PTHREAD_COND_INITIALIZER;
598 597
 pthread_mutex_t	res_pool_mutex = PTHREAD_MUTEX_INITIALIZER;
599 598
 
599
+
600 600
 int safe_res_query(const char *d, int c, int t, u_char *a, int l) {
601 601
 	int i = -1, ret;
602 602
 
... ...
@@ -622,6 +622,7 @@ int safe_res_query(const char *d, int c, int t, u_char *a, int l) {
622 622
 	pthread_mutex_unlock(&res_pool_mutex);
623 623
 	return ret;
624 624
 } 
625
+#endif /* HAVE_RESOLV_H */
625 626
 
626 627
 static void
627 628
 help(void)
... ...
@@ -1393,6 +1394,7 @@ main(int argc, char **argv)
1393 1393
 	if((max_children == 0) && ((cpt = cfgopt(copt, "MaxThreads")) != NULL))
1394 1394
 		max_children = cfgopt(copt, "MaxThreads")->numarg;
1395 1395
 
1396
+#if HAVE_RESOLV_H
1396 1397
 	/* allocate a pool of resolvers */
1397 1398
 	if(!(res_pool=cli_calloc(max_children+1, sizeof(*res_pool))))
1398 1399
 		return EX_OSERR;
... ...
@@ -1401,6 +1403,7 @@ main(int argc, char **argv)
1401 1401
 	memset(res_pool_state, 1, max_children+1);
1402 1402
 	for(i = 0; i < max_children+1; i++)
1403 1403
 		res_ninit(&res_pool[i]);
1404
+#endif
1404 1405
 
1405 1406
 	if((cpt = cfgopt(copt, "ReadTimeout")) != NULL) {
1406 1407
 		readTimeout = cpt->numarg;