[Ecls-list] Patch: print errno in ecl_internal_error()
Geo Carncross
geocar at gmail.com
Sun Jan 25 15:06:30 UTC 2009
You'll need to save errno first as printf() can clobber it. Also, strerror()
can modify errno as well.
On Sat, Jan 24, 2009 at 4:12 PM, Josh Elsasser <josh at elsasser.org> wrote:
> How about printing the errno and/or strerror(errno) value in
> ecl_internal_error()? There won't be a valid errno value in every
> situation where it's called, but having that information is still more
> useful than not.
>
> diff --git src/c/error.d src/c/error.d
> index 0214de3..a2f1dcb 100644
> --- src/c/error.d
> +++ src/c/error.d
> @@ -30,6 +30,8 @@ void
> ecl_internal_error(const char *s)
> {
> printf("\nInternal or unrecoverable error in:\n%s\n", s);
> + if (errno)
> + printf(" [%d: %s]\n", errno, strerror(errno));
> fflush(stdout);
> #ifdef SIGIOT
> signal(SIGIOT, SIG_DFL); /* avoid getting into a loop with abort */
>
>
> ------------------------------------------------------------------------------
> This SF.net email is sponsored by:
> SourcForge Community
> SourceForge wants to tell your story.
> http://p.sf.net/sfu/sf-spreadtheword
> _______________________________________________
> Ecls-list mailing list
> Ecls-list at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/ecls-list
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/ecl-devel/attachments/20090125/842d95d2/attachment.html>
More information about the ecl-devel
mailing list