wok rev 13544
busybox/blkid-swap.u: do not rely on vid->type
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Wed Oct 31 09:43:47 2012 +0100 (2012-10-31) |
parents | d53ecda155fa |
children | 851bcdb0f8aa |
files | busybox/stuff/busybox-1.20-blkid-swap.u |
line diff
1.1 --- a/busybox/stuff/busybox-1.20-blkid-swap.u Tue Oct 30 01:42:07 2012 +0000 1.2 +++ b/busybox/stuff/busybox-1.20-blkid-swap.u Wed Oct 31 09:43:47 2012 +0100 1.3 @@ -1,10 +1,25 @@ 1.4 Swap partitions may have neither label nor uuid 1.5 --- busybox-1.20.0/util-linux/volume_id/get_devname.c 1.6 +++ busybox-1.20.0/util-linux/volume_id/get_devname.c 1.7 -@@ -50,5 +50,5 @@ 1.8 - goto ret; 1.9 +@@ -46,10 +46,7 @@ 1.10 + if (ioctl(/*vid->*/fd, BLKGETSIZE64, &size) != 0) 1.11 + size = 0; 1.12 1.13 +- if (volume_id_probe_all(vid, /*0,*/ size) != 0) 1.14 +- goto ret; 1.15 +- 1.16 - if (vid->label[0] != '\0' || vid->uuid[0] != '\0') { 1.17 -+ if (vid->type) { 1.18 ++ if (volume_id_probe_all(vid, /*0,*/ size) == 0) { 1.19 *label = xstrndup(vid->label, sizeof(vid->label)); 1.20 *uuid = xstrndup(vid->uuid, sizeof(vid->uuid)); 1.21 + #if ENABLE_FEATURE_BLKID_TYPE 1.22 +--- busybox-1.20.0/util-linux/volume_id/volume_id.c 1.23 ++++ busybox-1.20.0/util-linux/volume_id/volume_id.c 1.24 +@@ -192,6 +192,7 @@ 1.25 + goto ret; 1.26 + } 1.27 + 1.28 ++ id->error = 1; 1.29 + ret: 1.30 + volume_id_free_buffer(id); 1.31 + return (- id->error); /* 0 or -1 */