mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-21 22:53:37 +00:00
daemon: Fix part-to-dev when the partition name includes p<N>.
If the device name ends with a number, Linux uses partition names of the form <device>p<N>. Handle this case by knocking off the 'p' character.
This commit is contained in:
committed by
Richard W.M. Jones
parent
5c350db94d
commit
6fd2ddb350
@@ -203,6 +203,9 @@ do_part_to_dev (const char *part)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (part[n-1] == 'p')
|
||||
n--;
|
||||
|
||||
char *r = strndup (part, n);
|
||||
if (r == NULL) {
|
||||
reply_with_perror ("strdup");
|
||||
|
||||
Reference in New Issue
Block a user