bug-gnulib
[Top][All Lists]
Advanced

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

Re: [bug-gnulib] valloc()?


From: Derek Price
Subject: Re: [bug-gnulib] valloc()?
Date: Thu, 03 Mar 2005 14:02:20 -0500
User-agent: Mozilla Thunderbird 1.0 (Windows/20041206)

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Bruno Haible wrote:

| Derek Price wrote:
|
|> Should this error still be exiting (EXIT_FAILURE) when this
|> function is defined to return NULL on failure?
|
|
| In this case the error is not "memory exhausted", it is "cannot
| open /dev/zero". This can happen for example if someone is working
| in a chroot environment that is incorrectly set up. I think a clear
| error message is good in this case. But I agree it's hard to say in
| advance which behaviour is better.


It could print the error message with error (0, errno, ...) and then
return NULL.  The caller could then decide if that error should be
fatal or not, as I presume they might wish to if they are calling
pagealign_alloc() as opposed to pagealign_xalloc().

Regards,

Derek
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (Cygwin)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFCJ188LD1OTBfyMaQRAisLAKCjzfZm7V5uPkRIXQ3ILJSLhHIHRwCgkNSz
qL4MjglKCWi/7OEocliSR28=
=ubwl
-----END PGP SIGNATURE-----






reply via email to

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