Browse code

fix compilation error under w32 (closes bug#68)

git-svn: trunk@2458

Tomasz Kojm authored on 2006/10/30 00:11:02
Showing 2 changed files
... ...
@@ -1,3 +1,7 @@
1
+Sun Oct 29 16:10:08 CET 2006 (tk)
2
+---------------------------------
3
+  * clamd/others.c: fix compilation error under w32 (closes bug#68)
4
+
1 5
 Sun Oct 29 15:36:21 CET 2006 (tk)
2 6
 ---------------------------------
3 7
   * clamscan, clamdscan: new option --copy, patch from aCaB
... ...
@@ -354,8 +354,10 @@ int readsock(int sockfd, char *buf, size_t size, unsigned char delim, int timeou
354 354
 	ssize_t n;
355 355
 	size_t boff = 0;
356 356
 	char *pdelim;
357
+#ifdef HAVE_RECVMSG
357 358
 	struct msghdr msg;
358 359
 	struct iovec iov[1];
360
+#endif
359 361
 #ifdef HAVE_CONTROL_IN_MSGHDR
360 362
 #ifndef CMSG_SPACE
361 363
 #define CMSG_SPACE(len)	    (_CMSG_ALIGN(sizeof(struct cmsghdr)) + _CMSG_ALIGN(len))
... ...
@@ -384,11 +386,13 @@ int readsock(int sockfd, char *buf, size_t size, unsigned char delim, int timeou
384 384
     n = recv(sockfd, buf, size, MSG_PEEK);
385 385
     if(read_command) {
386 386
     	if((n >= 1) && (buf[0] == 0)) { /* FD message */
387
+#ifdef HAVE_RECVMSG
387 388
 	    iov[0].iov_base = buf;
388 389
 	    iov[0].iov_len = size;
389 390
 	    memset(&msg, 0, sizeof(msg));
390 391
 	    msg.msg_iov = iov;
391 392
 	    msg.msg_iovlen = 1;
393
+#endif
392 394
 #ifdef HAVE_ACCRIGHTS_IN_MSGHDR
393 395
 	    msg.msg_accrights = (caddr_t)&fd;
394 396
 	    msg.msg_accrightslen = sizeof(fd);