Re: [BK PATCH] One strdup() to rule them all

From: Andries Brouwer
Date: Mon Aug 25 2003 - 12:50:08 EST


On Mon, Aug 25, 2003 at 01:05:30PM -0400, Jeff Garzik wrote:

> > > +char *strdup(const char *s)
> > > +{
> > > + char *rv = kmalloc(strlen(s)+1, GFP_KERNEL);
> > > + if (rv)
> > > + strcpy(rv, s);
> > > + return rv;
> > > +}

> Unfortunately Linus doesn't like the strdup cleanup, so I don't see this
> patch going in either :)

When seeing this my objection was: it introduces something with
a well-known name that uses GFP_KERNEL, so is not suitable everywhere -
an invitation to mistakes.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/