Fix mkfs.ext* arguments
authorMartin Pitt <martin.pitt@ubuntu.com>
Mon, 27 Sep 2010 18:40:22 +0000 (20:40 +0200)
committerMartin Pitt <martin.pitt@ubuntu.com>
Mon, 27 Sep 2010 18:40:22 +0000 (20:40 +0200)
Pass exactly one -F argument to mkfs.ext*, not one for each D-BUS method option
that we got (which meant none at all if there were no options). This fixes
creating ext* file systems on unpartitioned devices when supplying no option.

src/helpers/job-mkfs.c

index e363484..52db903 100644 (file)
@@ -136,9 +136,9 @@ main (int argc,
 
       s = g_string_new ("mkfs.");
       g_string_append (s, fstype);
+      g_string_append (s, " -F ");
       for (n = 0; options[n] != NULL; n++)
         {
-          g_string_append (s, " -F ");
           if (g_str_has_prefix (options[n], "label="))
             {
               label = strdup (options[n] + sizeof("label=") - 1);