diff mbox

[16/16] Use mapname to choose kpartx delimiter

Message ID 1367531197-8987-17-git-send-email-bmarzins@redhat.com (mailing list archive)
State Deferred, archived
Headers show

Commit Message

Benjamin Marzinski May 2, 2013, 9:46 p.m. UTC
When kpartx creates partition devices, it uses the mapname as the base
for the partition device names. However when choosing the delimiter,
it uses the device name passed in.  So if kpartx is called on /dev/dm-X
it will always add a 'p', even if the mapname ends in a letter.  This
patch fixes that by setting the delimiter based on the mapname.

Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
---
 kpartx/kpartx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox

Patch

diff --git a/kpartx/kpartx.c b/kpartx/kpartx.c
index 30b3bd9..98d88c0 100644
--- a/kpartx/kpartx.c
+++ b/kpartx/kpartx.c
@@ -348,7 +348,7 @@  main(int argc, char **argv){
 	if (delim == NULL) {
 		delim = malloc(DELIM_SIZE);
 		memset(delim, 0, DELIM_SIZE);
-		set_delimiter(device, delim);
+		set_delimiter(mapname, delim);
 	}
 
 	fd = open(device, O_RDONLY);