[prev in list] [next in list] [prev in thread] [next in thread] 

List:       busybox
Subject:    Re: [PATCH] do not ignore mmc or micro sd block devices
From:       Denys Vlasenko <vda.linux () googlemail ! com>
Date:       2010-02-24 7:14:59
Message-ID: 201002240814.59068.vda.linux () googlemail ! com
[Download RAW message or body]

On Tuesday 23 February 2010 21:10, Waldemar Brodkorb wrote:
> On Linux MMC or MicroSD devices are named f.e. mmcblk0 like
> on a FOX Board G20. When using fdisk -l on such targets, the
> partition table is not listed. With this patch you get the requested
> output.
> 
> Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
> ---
>  util-linux/fdisk.c |    4 +++-
>  1 files changed, 3 insertions(+), 1 deletions(-)
> 
> diff --git a/util-linux/fdisk.c b/util-linux/fdisk.c
> index a731316..101bba5 100644
> --- a/util-linux/fdisk.c
> +++ b/util-linux/fdisk.c
> @@ -2804,7 +2804,9 @@ list_devs_in_proc_partititons(void)
>  		for (s = ptname; *s; s++)
>  			continue;
>  		if (isdigit(s[-1]))
> -			continue;
> +			if (s[-1] != '0')
> +				continue;
> +
>  		sprintf(devname, "/dev/%s", ptname);
>  		open_list_and_close(devname, 0);
>  	}

Committed to git this one:

                for (s = ptname; *s; s++)
-                       continue;
-               if (isdigit(s[-1]))
+                       continue;
+               /* note: excluding '0': e.g. mmcblk0 is not a partition name! */
+               if (s[-1] >= '1' && s[-1] <= '9')
                        continue;

Thanks!
--
vda
_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic