logger() now handles Foreground mode

git-svn: trunk@1592
remotes/push_mirror/metadata
Nigel Horne 20 years ago
parent a0ad1655d2
commit cc8bc4bd6e
  1. 13
      clamav-devel/clamav-milter/clamav-milter.c

@ -22,7 +22,7 @@
*
* For installation instructions see the file INSTALL that came with this file
*/
static char const rcsid[] = "$Id: clamav-milter.c,v 1.207 2005/05/28 10:28:52 nigelhorne Exp $";
static char const rcsid[] = "$Id: clamav-milter.c,v 1.208 2005/05/28 11:37:27 nigelhorne Exp $";
#define CM_VERSION "0.85e"
@ -1382,7 +1382,6 @@ main(int argc, char **argv)
return EX_CANTCREAT;
}
}
logFile = strdup(logFile);
} else {
logFile = console;
if(consolefd < 0) {
@ -5036,7 +5035,12 @@ logger(const char *mess)
#ifdef CL_DEBUG
puts(mess);
#else
FILE *fout = fopen(logFile, "a");
FILE *fout;
if(cfgopt(copt, "Foreground"))
fout = stderr;
else
fout = fopen(logFile, "a");
if(fout == NULL)
return;
@ -5058,6 +5062,7 @@ logger(const char *mess)
#endif
} else
fprintf(fout, "%s\n", mess);
fclose(fout);
if(fout != stderr)
fclose(fout);
#endif
}

Loading…
Cancel
Save