All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bernhard Voelker <mail@bernhard-voelker.de>
To: dave@gnu.org
Cc: Karel Zak <kzak@redhat.com>, Petr Uzel <petr.uzel@suse.cz>,
	util-linux <util-linux@vger.kernel.org>
Subject: Re: [PATCH 03/10] fdisk: API: add fdisk_label_change
Date: Tue, 24 Jul 2012 11:47:53 +0200	[thread overview]
Message-ID: <500E6F49.60406@bernhard-voelker.de> (raw)
In-Reply-To: <1342976704.2863.13.camel@offbook>



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

  reply	other threads:[~2012-07-24  9:47 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-22 17:05 [PATCH 03/10] fdisk: API: add fdisk_label_change Davidlohr Bueso
2012-07-24  9:47 ` Bernhard Voelker [this message]
2012-07-24  9:56   ` Petr Uzel
2012-07-24 10:32     ` Bernhard Voelker
2012-07-24 10:39       ` Davidlohr Bueso
2012-07-24 10:42         ` Petr Uzel
2012-07-24 10:47           ` Bernhard Voelker
2012-07-24  9:52 ` Petr Uzel
2012-07-24 10:41   ` Davidlohr Bueso
2012-07-24 10:52     ` Petr Uzel
2012-07-24 11:35 ` Karel Zak

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=500E6F49.60406@bernhard-voelker.de \
    --to=mail@bernhard-voelker.de \
    --cc=dave@gnu.org \
    --cc=kzak@redhat.com \
    --cc=petr.uzel@suse.cz \
    --cc=util-linux@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.