projects
/
ossec-hids.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
- fortify/harden the compile
[ossec-hids.git]
/
src
/
monitord
/
compress_log.c
diff --git
a/src/monitord/compress_log.c
b/src/monitord/compress_log.c
index
7cf11bd
..
5ebfc68
100755
(executable)
--- a/
src/monitord/compress_log.c
+++ b/
src/monitord/compress_log.c
@@
-1,11
+1,12
@@
-/* @(#) $Id: compress_log.c,v 1.4 2009/06/24 17:06:27 dcid Exp $ */
+/* @(#) $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
/* 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 3) as published by the FSF - Free Software
+ * License (version 2) as published by the FSF - Free Software
* Foundation
*/
* Foundation
*/
@@
-19,18
+20,18
@@
void OS_CompressLog(char *logfile)
{
FILE *log;
gzFile *zlog;
{
FILE *log;
gzFile *zlog;
-
+
char logfileGZ[OS_FLSIZE + 1];
int len, err;
char logfileGZ[OS_FLSIZE + 1];
int len, err;
-
+
char buf[OS_MAXSTR + 1];
char buf[OS_MAXSTR + 1];
-
+
/* Do not compress */
if(mond.compress == 0)
return;
/* Do not compress */
if(mond.compress == 0)
return;
-
-
+
+
/* Clearing the memory */
memset(logfileGZ,'\0',OS_FLSIZE +1);
memset(buf, '\0', OS_MAXSTR + 1);
/* 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;
}
/* Do not warn in here, since the alert file may not exist. */
return;
}
-
+
/* Opening compressed file */
zlog = gzopen(logfileGZ, "w");
if(!zlog)
/* Opening compressed file */
zlog = gzopen(logfileGZ, "w");
if(!zlog)
@@
-60,7
+61,7
@@
void OS_CompressLog(char *logfile)
merror(FOPEN_ERROR, ARGV0, logfileGZ);
return;
}
merror(FOPEN_ERROR, ARGV0, logfileGZ);
return;
}
-
+
for(;;)
{
len = fread(buf, 1, OS_MAXSTR, log);
for(;;)
{
len = fread(buf, 1, OS_MAXSTR, log);
@@
-79,6
+80,6
@@
void OS_CompressLog(char *logfile)
return;
}
return;
}
-
+
/* EOF */
/* EOF */