From: Richard Jones Date: Thu, 7 May 2009 15:57:55 +0000 (+0100) Subject: /dev/hd* is also a block device on RHEL 5. X-Git-Tag: 1.0.19~6 X-Git-Url: http://git.annexia.org/?p=libguestfs.git;a=commitdiff_plain;h=db1aacb8e0ac28283e1d9f7d02119868de19836b /dev/hd* is also a block device on RHEL 5. --- diff --git a/daemon/devsparts.c b/daemon/devsparts.c index 324b887..0a4d5e4 100644 --- a/daemon/devsparts.c +++ b/daemon/devsparts.c @@ -45,7 +45,8 @@ do_list_devices (void) } while ((d = readdir (dir)) != NULL) { - if (strncmp (d->d_name, "sd", 2) == 0) { + if (strncmp (d->d_name, "sd", 2) == 0 || + strncmp (d->d_name, "hd", 2) == 0) { snprintf (buf, sizeof buf, "/dev/%s", d->d_name); if (add_string (&r, &size, &alloc, buf) == -1) { closedir (dir); @@ -85,7 +86,8 @@ do_list_partitions (void) } while ((d = readdir (dir)) != NULL) { - if (strncmp (d->d_name, "sd", 2) == 0) { + if (strncmp (d->d_name, "sd", 2) == 0 || + strncmp (d->d_name, "hd", 2) == 0) { strncpy (devname, d->d_name, sizeof devname); devname[sizeof devname - 1] = '\0';