failure.
Put back lost PRINT_DRIVE.
+2012-02-03 Richard Laager <rlaager@wiktel.com>
+
+ * util/grub-probe.c (probe): Don't crash on canonicalize_file_name
+ failure.
+ Put back lost PRINT_DRIVE.
+
2012-02-03 Richard Laager <rlaager@wiktel.com>
* util/getroot.c (find_root_devices_from_libzfs): Fix compilation error.
int root, dm;
*cur = canonicalize_file_name (tmp);
if (*cur == NULL)
- {
- grub_util_error (_("failed to get canonical path of %s"), tmp);
- break;
- }
+ grub_util_error (_("failed to get canonical path of %s"), tmp);
free (tmp);
root = (strcmp (*cur, "/dev/root") == 0);
dm = (strncmp (*cur, "/dev/dm-", sizeof ("/dev/dm-") - 1) == 0);
if (path != NULL)
{
grub_path = canonicalize_file_name (path);
+ if (! grub_path)
+ grub_util_error (_("failed to get canonical path of %s"), path);
device_names = grub_guess_root_devices (grub_path);
free (grub_path);
}
}
*curdrive = 0;
+ if (print == PRINT_DRIVE)
+ {
+ for (curdrive = drives_names; *curdrive; curdrive++)
+ {
+ printf ("(%s)", *curdrive);
+ putchar (delim);
+ }
+ goto end;
+ }
+
if (print == PRINT_FS || print == PRINT_FS_UUID
|| print == PRINT_FS_LABEL)
{