logging: make gcc 4.4.3 happy about ignored unused results

This commit is contained in:
Dan Williams
2011-01-24 14:13:28 -06:00
parent 98ec26283a
commit 245b893e98

View File

@@ -64,6 +64,7 @@ _mm_log (const char *loc,
char msgbuf[512] = { 0 }; char msgbuf[512] = { 0 };
int syslog_priority = LOG_INFO; int syslog_priority = LOG_INFO;
const char *prefix = NULL; const char *prefix = NULL;
ssize_t ign;
if (!(log_level & level)) if (!(log_level & level))
return; return;
@@ -112,7 +113,9 @@ _mm_log (const char *loc,
if (logfd < 0) if (logfd < 0)
syslog (syslog_priority, "%s", msgbuf); syslog (syslog_priority, "%s", msgbuf);
else { else {
(void) write (logfd, msgbuf, strlen (msgbuf)); ign = write (logfd, msgbuf, strlen (msgbuf));
if (ign) {} /* whatever; really shut up about unused result */
fsync (logfd); /* Make sure output is dumped to disk immediately */ fsync (logfd); /* Make sure output is dumped to disk immediately */
} }
} }
@@ -127,6 +130,7 @@ log_handler (const gchar *log_domain,
gpointer ignored) gpointer ignored)
{ {
int syslog_priority; int syslog_priority;
ssize_t ign;
switch (level) { switch (level) {
case G_LOG_LEVEL_ERROR: case G_LOG_LEVEL_ERROR:
@@ -152,8 +156,10 @@ log_handler (const gchar *log_domain,
if (logfd < 0) if (logfd < 0)
syslog (syslog_priority, "%s", message); syslog (syslog_priority, "%s", message);
else else {
(void) write (logfd, message, strlen (message)); ign = write (logfd, message, strlen (message));
if (ign) {} /* whatever; really shut up about unused result */
}
} }
gboolean gboolean