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@xxxxxxxxxxxxxxx > More majordomo info at http://vger.kernel.org/majordomo-info.html Petr -- Petr Uzel IRC: ptr_uzl @ freenode
Attachment:
pgplcxy_D6HZq.pgp
Description: PGP signature