r4620 - trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/phone-kit

john_lee at docs.openmoko.org john_lee at docs.openmoko.org
Wed Sep 3 11:14:54 CEST 2008


Author: john_lee
Date: 2008-09-03 11:14:52 +0200 (Wed, 03 Sep 2008)
New Revision: 4620

Modified:
   trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/phone-kit/dialer-main.c
Log:
#1834: openmoko-dialer2 crashes when no dbus connection could be set

patch created by LeRoutier
commited by John Lee <john_lee at openmoko.com>


Modified: trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/phone-kit/dialer-main.c
===================================================================
--- trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/phone-kit/dialer-main.c	2008-09-02 08:47:21 UTC (rev 4619)
+++ trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/phone-kit/dialer-main.c	2008-09-03 09:14:52 UTC (rev 4620)
@@ -402,13 +402,15 @@
   GError *error = NULL;
   guint32 ret;
 
-  DBusError err = {0};
+  DBusError err;
+  // initialise the error value
+  dbus_error_init(&err);
+
   DBusConnection* bus = dbus_bus_get (DBUS_BUS_SESSION, &err);
-
-  if (!bus)
+  if (dbus_error_is_set(&err))
   {   
-     gchar buffer[100];
-     sprintf (buffer, "Failed to connect to the D-BUS daemon: %s", err.message);
+     gchar buffer[200];
+     g_snprintf ( buffer, 200, "Failed to connect to the D-BUS daemon: %s", err.message);
      g_critical (buffer);
      dbus_error_free (&err);
      return 1;




More information about the commitlog mailing list