fix up inhibit parameter handling
authorMatthias Clasen <mclasen@redhat.com>
Tue, 17 Mar 2009 00:48:17 +0000 (20:48 -0400)
committerDavid Zeuthen <davidz@redhat.com>
Tue, 17 Mar 2009 00:48:17 +0000 (20:48 -0400)
See https://bugzilla.redhat.com/show_bug.cgi?id=488850

tools/devkit-disks.c

index b7b9c79..7ebc931 100644 (file)
@@ -1060,6 +1060,11 @@ do_inhibit_polling (const char *object_path,
         cookie = NULL;
         ret = 127;
 
+       if (argc > 0 && strcmp (argv[0], "--") == 0) {
+               argv++;
+               argc--;
+       }
+
        proxy = dbus_g_proxy_new_for_name (bus,
                                            "org.freedesktop.DeviceKit.Disks",
                                            object_path,
@@ -1127,6 +1132,11 @@ do_inhibit_all_polling (gint         argc,
         cookie = NULL;
         ret = 127;
 
+       if (argc > 0 && strcmp (argv[0], "--") == 0) {
+               argv++;
+               argc--;
+       }
+
        proxy = dbus_g_proxy_new_for_name (bus,
                                            "org.freedesktop.DeviceKit.Disks",
                                            "/",
@@ -1192,6 +1202,11 @@ do_inhibit (gint         argc,
         cookie = NULL;
         ret = 127;
 
+       if (argc > 0 && strcmp (argv[0], "--") == 0) {
+               argv++;
+               argc--;
+       }
+
        proxy = dbus_g_proxy_new_for_name (bus,
                                            "org.freedesktop.DeviceKit.Disks",
                                            "/",