There where two convention errors in spacing.  Corrected.

 Attached is the patch.

-
Rakesh Pandit
diff --git a/parted/parted.c b/parted/parted.c
index 0f6768b..9ab2463 100644
--- a/parted/parted.c
+++ b/parted/parted.c
@@ -181,6 +181,17 @@ _timer_handler (PedTimer* timer, void* context)
         }
 }
 
+static void
+_superuser_warn ()
+{
+#ifdef HAVE_GETUID
+        if (getuid() != 0 && !opt_script_mode) {
+            puts (_("WARNING: You are not superuser.  Watch out for "
+                    "permissions."));
+        }
+#endif  
+}
+
 static int
 _partition_warn_busy (PedPartition* part)
 {
@@ -1573,11 +1584,23 @@ _print_list ()
 {
         PedDevice *current_dev = NULL;
 
-        ped_device_probe_all();
+	_superuser_warn ();
+retry:
+        ped_device_probe_all ();
+        current_dev = ped_device_get_next (NULL);
 
-        while ((current_dev = ped_device_get_next(current_dev))) {
+        if (!current_dev) {
+                if (ped_exception_throw (PED_EXCEPTION_ERROR,
+                        PED_EXCEPTION_RETRY_CANCEL,
+                        _("No device found"))
+                                == PED_EXCEPTION_RETRY)
+                        goto retry;
+	}
+
+        while (current_dev) {
                 do_print (&current_dev);
                 putchar ('\n');
+                current_dev = ped_device_get_next (current_dev);
         }    
 
         return 1;
@@ -2429,12 +2452,7 @@ _init_commands ();
 if (!_parse_options (argc_ptr, argv_ptr))
         goto error_done_commands;
 
-#ifdef HAVE_GETUID
-        if (getuid() != 0 && !opt_script_mode) {
-            puts (_("WARNING: You are not superuser.  Watch out for "
-                    "permissions."));
-        }
-#endif
+_superuser_warn ();
 
 dev = _choose_device (argc_ptr, argv_ptr);
 if (!dev)
_______________________________________________
parted-devel mailing list
[email protected]
http://lists.alioth.debian.org/mailman/listinfo/parted-devel

Reply via email to