/*
- * "$Id: log.c 5194 2006-02-27 20:57:07Z mike $"
+ * "$Id: log.c 5493 2006-05-05 16:33:57Z mike $"
*
* Log file routines for the Common UNIX Printing System (CUPS).
*
- * Copyright 1997-2005 by Easy Software Products, all rights reserved.
+ * Copyright 1997-2006 by Easy Software Products, all rights reserved.
*
* These coded instructions, statements, and computer programs are the
* property of Easy Software Products and are protected by Federal
*
* Contents:
*
- * cupsdGetDateTime() - Returns a pointer to a date/time string.
- * cupsdLogMessage() - Log a message to the error log file.
- * cupsdLogPage() - Log a page to the page log file.
- * cupsdLogRequest() - Log an HTTP request in Common Log Format.
- * check_log_file() - Open/rotate a log file if it needs it.
+ * cupsdGetDateTime() - Returns a pointer to a date/time string.
+ * cupsdLogMessage() - Log a message to the error log file.
+ * cupsdLogPage() - Log a page to the page log file.
+ * cupsdLogRequest() - Log an HTTP request in Common Log Format.
+ * check_log_file() - Open/rotate a log file if it needs it.
*/
/*
* Format the filename as needed...
*/
- if (!*lf || (cupsFileTell(*lf) > MaxLogSize && MaxLogSize > 0))
+ if (!*lf ||
+ (strncmp(logname, "/dev/", 5) && cupsFileTell(*lf) > MaxLogSize &&
+ MaxLogSize > 0))
{
/*
* Handle format strings...
* Do we need to rotate the log?
*/
- if (cupsFileTell(*lf) > MaxLogSize && MaxLogSize > 0)
+ if (strncmp(logname, "/dev/", 5) && cupsFileTell(*lf) > MaxLogSize &&
+ MaxLogSize > 0)
{
/*
* Rotate log file...
return (0);
}
- if (strncmp(filename, "/dev/", 5))
- {
- /*
- * Change ownership and permissions of non-device logs...
- */
+ /*
+ * Change ownership and permissions of non-device logs...
+ */
- fchown(cupsFileNumber(*lf), RunUser, Group);
- fchmod(cupsFileNumber(*lf), LogFilePerm);
- }
+ fchown(cupsFileNumber(*lf), RunUser, Group);
+ fchmod(cupsFileNumber(*lf), LogFilePerm);
}
return (1);
/*
- * End of "$Id: log.c 5194 2006-02-27 20:57:07Z mike $".
+ * End of "$Id: log.c 5493 2006-05-05 16:33:57Z mike $".
*/