tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: rpcgen(1), issues with System XVI



In article <20150921091341.GB10559%britannica.bec.de@localhost>,
Joerg Sonnenberger  <joerg%britannica.bec.de@localhost> wrote:
>On Mon, Sep 21, 2015 at 01:29:25AM +0000, David Holland wrote:
>> On Sun, Sep 20, 2015 at 10:22:27PM +0200, Joerg Sonnenberger wrote:
>>  > > > malloc sets errno, why use errx?
>>  > > 
>>  > > historically malloc didn't, and rpcgen is Olde...
>>  > 
>>  > I think the better reason is that the errno value set by malloc tends to
>>  > be not very useful -- ENOMEM.
>> 
>> That prints "Cannot allocate memory", which is as good as anything
>> else for this...
>
>The point is that any malloc failure will provide it, so it is
>completely redundant.

Until you get an update in the standard that allows for more errors,
or you internationalize the program, or you really care about size.
Then you'll need to fix the hard-coded string which is redundant in
the first place

christos



Home | Main Index | Thread Index | Old Index