diff options
author | hugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2005-05-16 18:14:33 +0000 |
---|---|---|
committer | hugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2005-05-16 18:14:33 +0000 |
commit | ce6f06b18668f4fb7cbcb593171be4c6e0692ce4 (patch) | |
tree | 496f70c751645e617131dc75d7627183da365475 /src/zabbix_agent/logfiles.c | |
parent | 20ff0332e4cebfb212300f3d9496f14e400a6234 (diff) | |
download | zabbix-ce6f06b18668f4fb7cbcb593171be4c6e0692ce4.tar.gz zabbix-ce6f06b18668f4fb7cbcb593171be4c6e0692ce4.tar.xz zabbix-ce6f06b18668f4fb7cbcb593171be4c6e0692ce4.zip |
Misc changes.
git-svn-id: svn://svn.zabbix.com/trunk@1775 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'src/zabbix_agent/logfiles.c')
-rw-r--r-- | src/zabbix_agent/logfiles.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/zabbix_agent/logfiles.c b/src/zabbix_agent/logfiles.c index a71c97cf..fe1c9ac9 100644 --- a/src/zabbix_agent/logfiles.c +++ b/src/zabbix_agent/logfiles.c @@ -32,20 +32,19 @@ #include "log.h" #include "logfiles.h" -int process_log(char *filename,int lastlogsize, char *value) +int process_log(char *filename,int *lastlogsize, char *value) { FILE *f; struct stat buf; - zabbix_log( LOG_LEVEL_WARNING, "In process log (%s,%d)", filename, lastlogsize); + zabbix_log( LOG_LEVEL_DEBUG, "In process log (%s,%d)", filename, *lastlogsize); /* Handling of file shrinking */ if(stat(filename,&buf) == 0) { - NOT SUPPORTED YET - if(buf.st_size<lastlogsize) + if(buf.st_size<*lastlogsize) { - lastlogsize=0; + *lastlogsize=0; } } else @@ -63,9 +62,9 @@ int process_log(char *filename,int lastlogsize, char *value) return 1; } - if(-1 == fseek(f,lastlogsize,SEEK_SET)) + if(-1 == fseek(f,*lastlogsize,SEEK_SET)) { - zabbix_log( LOG_LEVEL_WARNING, "Cannot set postition to [%d] for [%s] [%s]", lastlogsize, filename, strerror(errno)); + zabbix_log( LOG_LEVEL_WARNING, "Cannot set postition to [%d] for [%s] [%s]", *lastlogsize, filename, strerror(errno)); snprintf(value,MAX_STRING_LEN-1,"%s","ZBX_NOTSUPPORTED\n"); fclose(f); return 1; @@ -79,5 +78,7 @@ int process_log(char *filename,int lastlogsize, char *value) } fclose(f); + *lastlogsize+=strlen(value); + return 0; } |