summaryrefslogtreecommitdiff
path: root/scheduler/statbuf.c
diff options
context:
space:
mode:
authormsweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be>2008-06-27 20:26:20 +0000
committermsweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be>2008-06-27 20:26:20 +0000
commit75bd9771f6e44fdd887ee90faac46f403aefc0fc (patch)
tree354e3067522df9490e905772f73b72bfed8733ae /scheduler/statbuf.c
parentdd1abb6b5f145c5e5f279d8848b5f3ec161fd227 (diff)
Merge changes from CUPS 1.4svn-r7696.
git-svn-id: svn+ssh://src.apple.com/svn/cups/easysw/current@818 a1ca3aef-8c08-0410-bb20-df032aa958be
Diffstat (limited to 'scheduler/statbuf.c')
-rw-r--r--scheduler/statbuf.c81
1 files changed, 42 insertions, 39 deletions
diff --git a/scheduler/statbuf.c b/scheduler/statbuf.c
index a650f867b..c4959cfbe 100644
--- a/scheduler/statbuf.c
+++ b/scheduler/statbuf.c
@@ -1,10 +1,10 @@
/*
- * "$Id: statbuf.c 6649 2007-07-11 21:46:42Z mike $"
+ * "$Id: statbuf.c 7674 2008-06-18 23:18:32Z mike $"
*
* Status buffer routines for the Common UNIX Printing System (CUPS)
* scheduler.
*
- * Copyright 2007 by Apple Inc.
+ * Copyright 2007-2008 by Apple Inc.
* Copyright 1997-2006 by Easy Software Products, all rights reserved.
*
* These coded instructions, statements, and computer programs are the
@@ -15,8 +15,8 @@
*
* Contents:
*
- * cupsdStatBufNew() - Create a new status buffer.
* cupsdStatBufDelete() - Destroy a status buffer.
+ * cupsdStatBufNew() - Create a new status buffer.
* cupsdStatBufUpdate() - Update the status buffer.
*/
@@ -29,6 +29,30 @@
/*
+ * 'cupsdStatBufDelete()' - Destroy a status buffer.
+ */
+
+void
+cupsdStatBufDelete(cupsd_statbuf_t *sb) /* I - Status buffer */
+{
+ /*
+ * Range check input...
+ */
+
+ if (!sb)
+ return;
+
+ /*
+ * Close the status pipe and free memory used...
+ */
+
+ close(sb->fd);
+
+ free(sb);
+}
+
+
+/*
* 'cupsdStatBufNew()' - Create a new status buffer.
*/
@@ -90,30 +114,6 @@ cupsdStatBufNew(int fd, /* I - File descriptor of pipe */
/*
- * 'cupsdStatBufDelete()' - Destroy a status buffer.
- */
-
-void
-cupsdStatBufDelete(cupsd_statbuf_t *sb) /* I - Status buffer */
-{
- /*
- * Range check input...
- */
-
- if (!sb)
- return;
-
- /*
- * Close the status pipe and free memory used...
- */
-
- close(sb->fd);
-
- free(sb);
-}
-
-
-/*
* 'cupsdStatBufUpdate()' - Update the status buffer.
*/
@@ -288,20 +288,23 @@ cupsdStatBufUpdate(cupsd_statbuf_t *sb, /* I - Status buffer */
* Send it to the log file as needed...
*/
- if (*loglevel > CUPSD_LOG_NONE &&
- (*loglevel != CUPSD_LOG_INFO || LogLevel == CUPSD_LOG_DEBUG2))
+ if (sb->prefix[0])
{
- /*
- * General status message; send it to the error_log file...
- */
+ if (*loglevel > CUPSD_LOG_NONE &&
+ (*loglevel != CUPSD_LOG_INFO || LogLevel == CUPSD_LOG_DEBUG2))
+ {
+ /*
+ * General status message; send it to the error_log file...
+ */
- if (message[0] == '[')
- cupsdLogMessage(*loglevel, "%s", message);
- else
- cupsdLogMessage(*loglevel, "%s %s", sb->prefix, message);
+ if (message[0] == '[')
+ cupsdLogMessage(*loglevel, "%s", message);
+ else
+ cupsdLogMessage(*loglevel, "%s %s", sb->prefix, message);
+ }
+ else if (*loglevel < CUPSD_LOG_NONE && LogLevel == CUPSD_LOG_DEBUG2)
+ cupsdLogMessage(CUPSD_LOG_DEBUG2, "%s %s", sb->prefix, sb->buffer);
}
- else if (*loglevel < CUPSD_LOG_NONE && LogLevel == CUPSD_LOG_DEBUG2)
- cupsdLogMessage(CUPSD_LOG_DEBUG2, "%s %s", sb->prefix, sb->buffer);
/*
* Copy the message to the line buffer...
@@ -326,5 +329,5 @@ cupsdStatBufUpdate(cupsd_statbuf_t *sb, /* I - Status buffer */
/*
- * End of "$Id: statbuf.c 6649 2007-07-11 21:46:42Z mike $".
+ * End of "$Id: statbuf.c 7674 2008-06-18 23:18:32Z mike $".
*/