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

[-- Attachment #1: Type: text/plain, Size: 1454 bytes --]

On Tue, Jul 24, 2012 at 11:47:53AM +0200, Bernhard Voelker wrote:
> 
> 
> 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? 

What's the problem with these strings? I think these are well
recognized with clear meaning. What alternative do you propose?

Thanks,

        Petr


> (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@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

Petr

-- 
Petr Uzel
IRC: ptr_uzl @ freenode

[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]

  reply	other threads:[~2012-07-24  9:56 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
2012-07-24  9:56   ` Petr Uzel [this message]
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=20120724095617.GD2086@foxbat.suse.cz \
    --to=petr.uzel@suse.cz \
    --cc=dave@gnu.org \
    --cc=mail@bernhard-voelker.de \
    --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.