X-Git-Url: http://ftp.carnet.hr/carnet-debian/scm?p=ossec-hids.git;a=blobdiff_plain;f=src%2Fmonitord%2Fcompress_log.c;h=5ebfc688b975bd4faf4c1286c5d51b295e7a49af;hp=9f2fa102bdad312c13dc373b9503d69dc34fb567;hb=6ef2f786c6c8ead94841b5f93baf9f43421f08c8;hpb=301048b51990573e58a30dc4a5bb4ec285cad554 diff --git a/src/monitord/compress_log.c b/src/monitord/compress_log.c index 9f2fa10..5ebfc68 100755 --- a/src/monitord/compress_log.c +++ b/src/monitord/compress_log.c @@ -1,11 +1,12 @@ -/* @(#) $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 */ @@ -19,18 +20,18 @@ void OS_CompressLog(char *logfile) { 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); @@ -51,7 +52,7 @@ void OS_CompressLog(char *logfile) /* Do not warn in here, since the alert file may not exist. */ return; } - + /* Opening compressed file */ zlog = gzopen(logfileGZ, "w"); if(!zlog) @@ -60,7 +61,7 @@ void OS_CompressLog(char *logfile) merror(FOPEN_ERROR, ARGV0, logfileGZ); return; } - + for(;;) { len = fread(buf, 1, OS_MAXSTR, log); @@ -79,6 +80,6 @@ void OS_CompressLog(char *logfile) return; } - + /* EOF */