From: Faiyaz Ahmed Date: Thu, 3 Apr 2008 21:27:02 +0000 (+0000) Subject: Use logrotate to rotate logs. X-Git-Tag: CoDemux-0.1-9~3 X-Git-Url: http://git.onelab.eu/?p=codemux.git;a=commitdiff_plain;h=e1ad6360bb12a52f5defd22206f7127debe650bd Use logrotate to rotate logs. --- diff --git a/codemux.c b/codemux.c index efc8b1c..7d55e0d 100644 --- a/codemux.c +++ b/codemux.c @@ -1033,19 +1033,8 @@ static int OpenLogFile(void) { static const char* logfile = "/var/log/codemux.log"; - static const char* oldlogfile = "/var/log/codemux.log.old"; int logfd; - /* if the previous log file exists, - rename it to the oldlogfile */ - if (access(logfile, F_OK) == 0) { - if (rename(logfile, oldlogfile) < 0) { - fprintf(stderr, "cannot rotate the logfile err=%s\n", - strerror(errno)); - exit(-1); - } - } - logfd = open(logfile, O_WRONLY | O_APPEND | O_CREAT, 0600); if (logfd < 0) { fprintf(stderr, "cannot open the logfile err=%s\n",