Google
  Web www.spinics.net

Re: [PATCH 03/10] fdisk: API: add fdisk_label_change

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



On 07/22/2012 07:05 PM, Davidlohr Bueso wrote:
> --- a/fdisks/fdisksunlabel.c
> +++ b/fdisks/fdisksunlabel.c
> @@ -161,6 +161,7 @@ void create_sunlabel(struct fdisk_context *cxt)
>  
>  	init();
>  	fdisk_mbr_zeroize(cxt);
> +	fdisk_label_change(cxt, "sun");
>  

...

> +int fdisk_label_change(struct fdisk_context *cxt, const char *name)
> +{
> +	int i;
> +
> +	if (!cxt || !cxt->label || !name)
> +		return FDISK_ERROR_UNKNOWN;
> +
> +	/* not really changing the label */
> +	if (!strncmp(name, cxt->label->name, strlen(name)))
> +		goto done;
> +
> +	for (i = 0; i < ARRAY_SIZE(labels); i++) {
> +		if (strncmp(name, labels[i]->name, strlen(name)))
> +			continue;

Shouldn't we use something else than hardcoded "sun"|"dos"|"sgi"|...
strings here? (See also "[PATCH 08/10] fdisk: API: add create disklabel
to label operations".)

Have a nice day,
Berny
--
To unsubscribe from this list: send the line "unsubscribe util-linux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Site Home]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Memory]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Rubini]     [Photo]     [Yosemite]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]     [Video 4 Linux]     [Linux Resources]

Powered by Linux