-/* @(#) $Id$ */
+/* @(#) $Id: ./src/monitord/compress_log.c, 2011/09/08 dcid Exp $
+ */
/* Copyright (C) 2009 Trend Micro Inc.
* All right 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 2) as published by the FSF - Free Software
+ * License (version 2) as published by the FSF - Free Software
* Foundation
*/
{
FILE *log;
gzFile *zlog;
-
+
char logfileGZ[OS_FLSIZE + 1];
int len, err;
-
+
char buf[OS_MAXSTR + 1];
-
+
/* Do not compress */
if(mond.compress == 0)
return;
-
-
+
+
/* Clearing the memory */
memset(logfileGZ,'\0',OS_FLSIZE +1);
memset(buf, '\0', OS_MAXSTR + 1);
/* Do not warn in here, since the alert file may not exist. */
return;
}
-
+
/* Opening compressed file */
zlog = gzopen(logfileGZ, "w");
if(!zlog)
merror(FOPEN_ERROR, ARGV0, logfileGZ);
return;
}
-
+
for(;;)
{
len = fread(buf, 1, OS_MAXSTR, log);
return;
}
-
+
/* EOF */