[Mimedefang] MD 2.79 - very minor patch for mimedefang.multiplexor.c

Kevin A. McGrail KMcGrail at PCCC.com
Sun Feb 5 15:07:32 EST 2017


I'm sure it's an ancient gcc that I'm using but throwing an error 
compiling 2.79.  This is the only issue that stops compilation so I 
fixed it to define the var before setting a value.

gcc -g -O2 -Wall -Wstrict-prototypes -D_POSIX_PTHREAD_SEMANTICS 
-DEMBED_PERL -DSAFE_EMBED_PERL -DPERL_PATH=\"/usr/local/bin/perl\" 
-DMIMEDEFANG_PL=\"/usr/local/bin/mimedefang.pl\" -DRM=\"/bin/rm\" 
-DVERSION=\"2.79\" -DSPOOLDIR=\"/var/spool/MIMEDefang\" 
-DQDIR=\"/var/spool/MD-Quarantine\" -DCONFDIR=\"/etc/mail\"  -c -o 
mimedefang-multiplexor.o ./mimedefang-multiplexor.c
./mimedefang-multiplexor.c: In function `doSlaveReport':
./mimedefang-multiplexor.c:3548: parse error before `now'
./mimedefang-multiplexor.c:3581: `now' undeclared (first use in this 
function)
./mimedefang-multiplexor.c:3581: (Each undeclared identifier is reported 
only once
./mimedefang-multiplexor.c:3581: for each function it appears in.)
./mimedefang-multiplexor.c:3542: warning: `secs' might be used 
uninitialized in this function
make: *** [mimedefang-multiplexor.o] Error 1

--- mimedefang-multiplexor.org  Sun Feb  5 15:02:43 2017
+++ mimedefang-multiplexor.c    Sun Feb  5 15:03:05 2017
@@ -3538,6 +3538,7 @@
      char *ptr = ans;
      char status = '?';
      int i, j;
+    time_t now;

      int secs;
      if (!ans) {
@@ -3545,7 +3546,7 @@
         return;
      }
      *ans = 0;
-    time_t now = time(NULL);
+    now = time(NULL);

      for (i=0; i<Settings.maxSlaves; i++) {
         Slave *s = &AllSlaves[i];


Regards,
KAM



More information about the MIMEDefang mailing list