aboutsummaryrefslogtreecommitdiff
path: root/tests/test-libappindicator-fallback-watcher.c
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2010-02-22 12:56:03 -0600
committerTed Gould <ted@gould.cx>2010-02-22 12:56:03 -0600
commitbf13c7af125d97c2067da1b365ac4f11c2f2b943 (patch)
tree7e7d736b4356d276cf1b4691d7328c7b777c32da /tests/test-libappindicator-fallback-watcher.c
parenta067b5b0e1da84a381eb5ca5a426b87680dcc9f7 (diff)
downloadayatana-indicator-application-bf13c7af125d97c2067da1b365ac4f11c2f2b943.tar.gz
ayatana-indicator-application-bf13c7af125d97c2067da1b365ac4f11c2f2b943.tar.bz2
ayatana-indicator-application-bf13c7af125d97c2067da1b365ac4f11c2f2b943.zip
Fall out of the while, sometime, if we really think it's not recoverable.
Diffstat (limited to 'tests/test-libappindicator-fallback-watcher.c')
-rw-r--r--tests/test-libappindicator-fallback-watcher.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/tests/test-libappindicator-fallback-watcher.c b/tests/test-libappindicator-fallback-watcher.c
index c632dff..70e01d1 100644
--- a/tests/test-libappindicator-fallback-watcher.c
+++ b/tests/test-libappindicator-fallback-watcher.c
@@ -67,8 +67,15 @@ main (int argv, char ** argc)
DBusGProxy * bus_proxy = dbus_g_proxy_new_for_name(session_bus, DBUS_SERVICE_DBUS, DBUS_PATH_DBUS, DBUS_INTERFACE_DBUS);
gboolean has_owner = FALSE;
- while (!has_owner) {
+ gint owner_count = 0;
+ while (!has_owner && owner_count < 10000) {
org_freedesktop_DBus_name_has_owner(bus_proxy, "org.test", &has_owner, NULL);
+ owner_count++;
+ }
+
+ if (owner_count == 10000) {
+ g_error("Unable to get name owner after 10000 tries");
+ return 1;
}
g_usleep(250000);