diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/main.c | 25 |
1 files changed, 8 insertions, 17 deletions
@@ -133,23 +133,14 @@ name_lost_cb (GDBusConnection *connection, static void register_dbus_errors (void) { - static volatile guint32 aux = 0; - - if (aux) - return; - - /* Register all known own errors */ - aux |= MM_CORE_ERROR; - aux |= MM_MOBILE_EQUIPMENT_ERROR; - aux |= MM_CONNECTION_ERROR; - aux |= MM_SERIAL_ERROR; - aux |= MM_MESSAGE_ERROR; - aux |= MM_CDMA_ACTIVATION_ERROR; - - /* We no longer use MM_CORE_ERROR_CANCELLED in the daemon, we rely on - * G_IO_ERROR_CANCELLED internally */ - g_dbus_error_unregister_error (MM_CORE_ERROR, MM_CORE_ERROR_CANCELLED, MM_CORE_ERROR_DBUS_PREFIX ".Cancelled"); - g_dbus_error_register_error (G_IO_ERROR, G_IO_ERROR_CANCELLED, MM_CORE_ERROR_DBUS_PREFIX ".Cancelled"); + /* This method will always return success once during runtime */ + if (!mm_common_register_errors ()) + return; + + /* We no longer use MM_CORE_ERROR_CANCELLED in the daemon, we rely on + * G_IO_ERROR_CANCELLED internally */ + g_dbus_error_unregister_error (MM_CORE_ERROR, MM_CORE_ERROR_CANCELLED, MM_CORE_ERROR_DBUS_PREFIX ".Cancelled"); + g_dbus_error_register_error (G_IO_ERROR, G_IO_ERROR_CANCELLED, MM_CORE_ERROR_DBUS_PREFIX ".Cancelled"); } int |