diff --git a/logger.c b/logger.c index caae64f..64d4463 100644 --- a/logger.c +++ b/logger.c @@ -86,7 +86,7 @@ void LoggerSetDir(char *dirarg) { } fclose(fil); } else { - perror("open read error \n"); + printf("can not read %s\n", path); } } /*--------------------------------------------------------------------------*/ @@ -104,8 +104,7 @@ char *LoggerGetDir(void) { fprintf(fil, "%s%ld\n", LASTLOGTXT, (long)now); fclose(fil); } else { - printf("can not open %s\n", path); - perror("open write error \n"); + printf("can not write %s\n", path); } last = now; } @@ -259,7 +258,7 @@ int LoggerWrite(Logger *log, time_t now, int period, char *value) { int l; FILE *fil; - char path[PATH_MAX]; + char path[256]; char tim[256]; tm = localtime(&now); @@ -417,7 +416,7 @@ static void LoggerOut(Compressor *c, time_t t, float y) { char line[80]; /* printf("out %ld %g\n", t, y); */ - if (y != c->ylast) { + if (y != c->ylast || !c->exact) { c->ylast = y; if (y == LOGGER_NAN) { snprintf(line, sizeof line, "%ld\n", (long)(t - c->tlast));