[gnome-online-accounts] alarm, daemon: Avoid using %m for errors



commit a5045ffcab6340c329cdd480a3bd2a7b107eecb8
Author: Maya Rashish <coypu sdf org>
Date:   Fri Feb 12 17:02:06 2016 +0000

    alarm, daemon: Avoid using %m for errors
    
    It is a GNU extension and causes build problems and failures in other
    libc implementations (such as BSD libc).
    
    https://bugzilla.gnome.org/show_bug.cgi?id=761262

 src/daemon/goadaemon.c     |    6 +++++-
 src/goaidentity/goaalarm.c |    5 +++--
 2 files changed, 8 insertions(+), 3 deletions(-)
---
diff --git a/src/daemon/goadaemon.c b/src/daemon/goadaemon.c
index 744ad4d..d619740 100644
--- a/src/daemon/goadaemon.c
+++ b/src/daemon/goadaemon.c
@@ -17,6 +17,10 @@
  */
 
 #include "config.h"
+
+#include <errno.h>
+#include <string.h>
+
 #include <glib/gi18n.h>
 #include <gio/gdesktopappinfo.h>
 #include <rest/rest-proxy.h>
@@ -260,7 +264,7 @@ goa_daemon_init (GoaDaemon *self)
   path = g_strdup_printf ("%s/goa-1.0", g_get_user_config_dir ());
   if (g_mkdir_with_parents (path, 0755) != 0)
     {
-      g_warning ("Error creating directory %s: %m", path);
+      g_warning ("Error creating directory %s: %s", path, strerror (errno));
     }
   g_free (path);
 
diff --git a/src/goaidentity/goaalarm.c b/src/goaidentity/goaalarm.c
index 3c996c2..4fd437c 100644
--- a/src/goaidentity/goaalarm.c
+++ b/src/goaidentity/goaalarm.c
@@ -24,6 +24,7 @@
 #include <sys/timerfd.h>
 #endif
 
+#include <errno.h>
 #include <unistd.h>
 #include <string.h>
 
@@ -324,7 +325,7 @@ schedule_wakeups_with_timerfd (GoaAlarm *self)
 
   if (fd < 0)
     {
-      g_debug ("GoaAlarm: could not create timer fd: %m");
+      g_debug ("GoaAlarm: could not create timer fd: %s", strerror (errno));
       return FALSE;
     }
 
@@ -337,7 +338,7 @@ schedule_wakeups_with_timerfd (GoaAlarm *self)
 
   if (result < 0)
     {
-      g_debug ("GoaAlarm: could not set timer: %m");
+      g_debug ("GoaAlarm: could not set timer: %s", strerror (errno));
       return FALSE;
     }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]