[PATCH] make function rtnl_link_set_name() more reasonable

Hongwei Bi hwbi2008 at gmail.com
Wed Jan 15 09:40:24 EST 2014


Ok, the patch v2 has been submitted.

Thank you,
Hongwei

2014/1/14 Thomas Haller <thaller at redhat.com>:
> On Tue, 2014-01-07 at 13:02 +0000, Thomas Graf wrote:
>> On 01/02/14 at 12:28am, Hongwei Bi wrote:
>> > -extern void        rtnl_link_set_name(struct rtnl_link *, const char *);
>> > +extern int rtnl_link_set_name(struct rtnl_link *, const char *);
>>
>> Usually this would break ABI but changing void to int seems to be OK
>> from an ABI and API stability perspective.
>
> I would suggest not to change the behavior of the function. IMO
> rtnl_link_set_name() should continue to set the name (and truncate if
> necessary).
>
> But we should add a return value to indicate the truncation. So, it will
> work identical as before, and callers who care can detect the potential
> error.
>
> If you agree, could you please resubmit a patch and also adjust the code
> comment for rtnl_link_set_name()?
>
>
> Thank you,
> Thomas



More information about the libnl mailing list