diff options
author | Robert Ancell <robert.ancell@canonical.com> | 2011-09-15 16:27:37 +1000 |
---|---|---|
committer | Robert Ancell <robert.ancell@canonical.com> | 2011-09-15 16:27:37 +1000 |
commit | 63d37e05efaf5dfbecb70a92811cfd52521e38b5 (patch) | |
tree | 33c9083bf8452f38a2521df7d62eff37d33f0441 | |
parent | 3043b92923037c2d33592a90812d2a7a1866f105 (diff) | |
download | lightdm-63d37e05efaf5dfbecb70a92811cfd52521e38b5.tar.gz |
Add note about why we have an empty check on log write
-rw-r--r-- | src/lightdm.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/lightdm.c b/src/lightdm.c index 20d069e9..5582069c 100644 --- a/src/lightdm.c +++ b/src/lightdm.c @@ -69,6 +69,7 @@ log_cb (const gchar *log_domain, GLogLevelFlags log_level, { const gchar *prefix; gchar *text; + ssize_t n_written; switch (log_level & G_LOG_LEVEL_MASK) { case G_LOG_LEVEL_ERROR: @@ -95,7 +96,9 @@ log_cb (const gchar *log_domain, GLogLevelFlags log_level, } text = g_strdup_printf ("[%+.2fs] %s %s\n", g_timer_elapsed (log_timer, NULL), prefix, message); - if (write (log_fd, text, strlen (text)) < 0); + n_written = write (log_fd, text, strlen (text)); + if (n_written < 0) + ; /* Check result so compiler doesn't warn about it */ g_free (text); } |