From 55b254316dddeff4cc6068f15b8a63dad0be9e0e Mon Sep 17 00:00:00 2001 From: Nigel Horne Date: Sun, 19 Aug 2007 10:32:29 +0000 Subject: [PATCH] Fix compilation error on NetBSD2.0 git-svn: trunk@3177 --- ChangeLog | 4 ++++ clamav-milter/clamav-milter.c | 12 ++++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index f96e378c4c..5fbdd27d88 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Sun Aug 19 10:35:38 BST 2007 (njh) +---------------------------------- + * clamav-milter: Fix compilation error on NetBSD2.0 + Sat Aug 18 16:12:51 BST 2007 (njh) ---------------------------------- * clamav-milter: Black-hole-mode no longer needs to be run as root diff --git a/clamav-milter/clamav-milter.c b/clamav-milter/clamav-milter.c index 5128775124..e10b0a3459 100644 --- a/clamav-milter/clamav-milter.c +++ b/clamav-milter/clamav-milter.c @@ -33,7 +33,7 @@ */ static char const rcsid[] = "$Id: clamav-milter.c,v 1.312 2007/02/12 22:24:21 njh Exp $"; -#define CM_VERSION "devel-180807" +#define CM_VERSION "devel-190807" #if HAVE_CONFIG_H #include "clamav-config.h" @@ -1202,11 +1202,19 @@ main(int argc, char **argv) perror(SENDMAIL_BIN); are_trusted = 0; } else { + int status; char buf[BUFSIZ]; while(fgets(buf, sizeof(buf), sendmail) != NULL) ; - switch(WEXITSTATUS(pclose(sendmail))) { + /* + * Can't do + * switch(WEXITSTATUS(pclose(sendmail))) + * because that fails to compile on + * NetBSD2.0 + */ + status = pclose(sendmail); + switch(WEXITSTATUS(status)) { case EX_NOUSER: /* * No root? But at least