1 diff -up cups-1.5b1/scheduler/log.c.logrotate cups-1.5b1/scheduler/log.c
2 --- cups-1.5b1/scheduler/log.c.logrotate 2011-05-14 01:04:16.000000000 +0200
3 +++ cups-1.5b1/scheduler/log.c 2011-05-24 15:47:20.000000000 +0200
8 +#include <sys/types.h>
14 @@ -71,12 +74,10 @@ cupsdCheckLogFile(cups_file_t **lf, /* I
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 @@ -186,6 +187,34 @@ cupsdCheckLogFile(cups_file_t **lf, /* I
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?