1 diff -up cups-1.3.5/scheduler/log.c.logrotate cups-1.3.5/scheduler/log.c
2 --- cups-1.3.5/scheduler/log.c.logrotate 2008-02-14 12:21:25.000000000 +0000
3 +++ cups-1.3.5/scheduler/log.c 2008-02-14 12:24:16.000000000 +0000
8 +#include <sys/types.h>
14 @@ -467,12 +470,10 @@ check_log_file(cups_file_t **lf, /* IO -
18 - * Format the filename as needed...
19 + * Format the filename...
23 - (strncmp(logname, "/dev/", 5) && cupsFileTell(*lf) > MaxLogSize &&
25 + if (strncmp(logname, "/dev/", 5))
28 * Handle format strings...
29 @@ -565,6 +566,34 @@ check_log_file(cups_file_t **lf, /* IO -
33 + * Has someone else (i.e. logrotate) already rotated the log for us?
35 + else if (strncmp(filename, "/dev/", 5))
38 + if (stat(filename, &st) || st.st_size == 0)
40 + /* File is either missing or has zero size. */
43 + if ((*lf = cupsFileOpen(filename, "a")) == NULL)
45 + syslog(LOG_ERR, "Unable to open log file \"%s\" - %s", filename,
52 + * Change ownership and permissions of non-device logs...
55 + fchown(cupsFileNumber(*lf), RunUser, Group);
56 + fchmod(cupsFileNumber(*lf), LogFilePerm);
61 * Do we need to rotate the log?