-/* @(#) $Id: debug_op.c,v 1.15 2009/06/24 18:53:08 dcid Exp $ */
+/* @(#) $Id: ./src/shared/debug_op.c, 2011/09/08 dcid Exp $
+ */
/* Copyright (C) 2009 Trend Micro Inc.
* All rights reserved.
*
* This program is a free software; you can redistribute it
* and/or modify it under the terms of the GNU General Public
- * License (version 3) as published by the FSF - Free Software
+ * License (version 2) as published by the FSF - Free Software
* Foundation
*/
va_list args2;
FILE *fp;
-
+
tm = time(NULL);
p = localtime(&tm);
/* Duplicating args */
va_copy(args2, args);
-
+
/* If under chroot, log directly to /logs/ossec.log */
if(chroot_flag == 1)
if(fp)
{
(void)fprintf(fp,"%d/%02d/%02d %02d:%02d:%02d ",
- p->tm_year+1900,p->tm_mon+1,
+ p->tm_year+1900,p->tm_mon+1,
p->tm_mday,p->tm_hour,p->tm_min,p->tm_sec);
(void)vfprintf(fp, msg, args);
#ifdef WIN32
_log(msg, args);
daemon_flag = dbg_tmp;
-
+
va_end(args);
}
void ErrorExit(const char *msg, ...)
{
va_list args;
-
- #ifdef WIN32
+
+ #ifdef WIN32
/* If not MA */
#ifndef MA
WinSetError();
/* Print to stderr */
(void)vfprintf(stderr, msg, args);
-
+
#ifdef WIN32
(void)fprintf(stderr, "\r\n");
#else
(void)fprintf(stderr, "\n");
#endif
-
+
va_end(args);
}