bug-gnulib
[Top][All Lists]
Advanced

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

Re: [PATCH] xgethostbyname using realloc()


From: Bruno Haible
Subject: Re: [PATCH] xgethostbyname using realloc()
Date: Sat, 29 Aug 2009 10:33:59 +0200
User-agent: KMail/1.9.9

Jim Meyering wrote:
> Also, you've made it so upon failure it gives an
> inferior diagnostic, using perror, rather than "error".

Yes, the error message "<progname>: memory exhausted" is more understandable
for an end user than "realloc: Cannot allocate memory". End users don't
even know what 'realloc' is.

Additionally, it bypasses xalloc_die() and uses exit(1). But in GNU diff,
trouble like memory allocation failures must yield an exit code of 2, not 1.

Robert Millan wrote:
> > This makes it easier to import xgethostname.c into an external program.

You know that you are free to keep modified copies of gnulib code?
gnulib-tool explicitly supports this through its --local-dir option.
I did that for xmalloc.c for some time, until I realized that the one
in gnulib is really the best you can get.

Bruno




reply via email to

[Prev in Thread] Current Thread [Next in Thread]