Changeset d4946efe30b6cc3d3b901c8ec150f9810c020490
- Timestamp:
- 12/23/10 02:36:58 (2 years ago)
- Author:
- Nedko Arnaudov <nedko@…>
- Children:
- df4def70b2e17409817d2db70c5929d52cb489e7
- Parents:
- 67ba277fa541fe5b84e61569febc36a2c72bc249
- git-committer:
- Nedko Arnaudov <nedko@arnaudov.name> / 2010-12-23T02:36:58Z+0200
- Message:
-
gladish: Don't log dbus error when studio is not loaded on gladish start
- Files:
-
Legend:
- Unmodified
- Added
- Removed
-
|
r78e99c4
|
rd4946ef
|
|
| 190 | 190 | dbus_object_path_destroy(g_dbus_connection, g_control_object); |
| 191 | 191 | dbus_connection_unref(g_dbus_connection); |
| | 192 | dbus_call_last_error_cleanup(); |
| 192 | 193 | } |
| 193 | 194 | |
-
|
rff83486
|
rd4946ef
|
|
| 43 | 43 | DBusConnection * g_dbus_connection; |
| 44 | 44 | DBusError g_dbus_error; |
| | 45 | static char * g_dbus_call_last_error_name; |
| | 46 | static char * g_dbus_call_last_error_message; |
| 45 | 47 | |
| 46 | 48 | struct dbus_signal_hook_descriptor |
| … |
… |
|
| 62 | 64 | |
| 63 | 65 | LIST_HEAD(g_dbus_services); |
| | 66 | |
| | 67 | |
| | 68 | void dbus_call_last_error_cleanup(void) |
| | 69 | { |
| | 70 | free(g_dbus_call_last_error_name); |
| | 71 | g_dbus_call_last_error_name = NULL; |
| | 72 | |
| | 73 | free(g_dbus_call_last_error_message); |
| | 74 | g_dbus_call_last_error_message = NULL; |
| | 75 | } |
| | 76 | |
| | 77 | bool dbus_call_last_error_is_name(const char * name) |
| | 78 | { |
| | 79 | return g_dbus_call_last_error_name != NULL && strcmp(name, g_dbus_call_last_error_name) == 0; |
| | 80 | } |
| | 81 | |
| | 82 | const char * dbus_call_last_error_get_message(void) |
| | 83 | { |
| | 84 | return g_dbus_call_last_error_message != NULL ? g_dbus_call_last_error_message : ""; |
| | 85 | } |
| | 86 | |
| | 87 | static void dbus_call_last_error_set(void) |
| | 88 | { |
| | 89 | dbus_call_last_error_cleanup(); |
| | 90 | |
| | 91 | if (g_dbus_error.name != NULL) |
| | 92 | { |
| | 93 | g_dbus_call_last_error_name = strdup(g_dbus_error.name); |
| | 94 | } |
| | 95 | |
| | 96 | if (g_dbus_error.message != NULL) |
| | 97 | { |
| | 98 | g_dbus_call_last_error_message = strdup(g_dbus_error.message); |
| | 99 | } |
| | 100 | } |
| 64 | 101 | |
| 65 | 102 | bool dbus_iter_get_dict_entry(DBusMessageIter * iter_ptr, const char * key, void * value, int * type, int * size) |
| … |
… |
|
| 354 | 391 | if (reply_ptr == NULL) |
| 355 | 392 | { |
| 356 | | //log_error("calling method '%s' failed, error is '%s'", method, g_dbus_error.message); |
| | 393 | dbus_call_last_error_set(); |
| 357 | 394 | dbus_error_free(&g_dbus_error); |
| 358 | 395 | } |
-
|
rff83486
|
rd4946ef
|
|
| 112 | 112 | const char * service); |
| 113 | 113 | |
| | 114 | void dbus_call_last_error_cleanup(void); |
| | 115 | bool dbus_call_last_error_is_name(const char * name); |
| | 116 | const char * dbus_call_last_error_get_message(void); |
| | 117 | |
| 114 | 118 | #include "method.h" |
| 115 | 119 | #include "signal.h" |
-
|
r128ad4d
|
rd4946ef
|
|
| 56 | 56 | dbus_error_free(&g_dbus_error); |
| 57 | 57 | } |
| | 58 | |
| | 59 | dbus_call_last_error_cleanup(); |
| 58 | 60 | } |
-
|
r7a6f304
|
rd4946ef
|
|
| 299 | 299 | if (!dbus_call(0, SERVICE_NAME, STUDIO_OBJECT_PATH, IFACE_STUDIO, "GetRoomList", "", NULL, &reply_ptr)) |
| 300 | 300 | { |
| 301 | | log_error("Cannot fetch studio room list"); |
| | 301 | /* Don't log error if there is no studio loaded */ |
| | 302 | if (!dbus_call_last_error_is_name(DBUS_ERROR_UNKNOWN_METHOD)) |
| | 303 | { |
| | 304 | log_error("Cannot fetch studio room list: %s", dbus_call_last_error_get_message()); |
| | 305 | } |
| | 306 | |
| 302 | 307 | return; |
| 303 | 308 | } |