You'll need to save errno first as printf() can clobber it. Also, strerror() can modify errno as well.<br><br><div class="gmail_quote">On Sat, Jan 24, 2009 at 4:12 PM, Josh Elsasser <span dir="ltr"><<a href="mailto:josh@elsasser.org">josh@elsasser.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">How about printing the errno and/or strerror(errno) value in<br>
ecl_internal_error()? There won't be a valid errno value in every<br>
situation where it's called, but having that information is still more<br>
useful than not.<br>
<br>
diff --git src/c/error.d src/c/error.d<br>
index 0214de3..a2f1dcb 100644<br>
--- src/c/error.d<br>
+++ src/c/error.d<br>
@@ -30,6 +30,8 @@ void<br>
 ecl_internal_error(const char *s)<br>
 {<br>
        printf("\nInternal or unrecoverable error in:\n%s\n", s);<br>
+       if (errno)<br>
+               printf("  [%d: %s]\n", errno, strerror(errno));<br>
        fflush(stdout);<br>
 #ifdef SIGIOT<br>
        signal(SIGIOT, SIG_DFL); /* avoid getting into a loop with abort */<br>
<br>
------------------------------------------------------------------------------<br>
This SF.net email is sponsored by:<br>
SourcForge Community<br>
SourceForge wants to tell your story.<br>
<a href="http://p.sf.net/sfu/sf-spreadtheword" target="_blank">http://p.sf.net/sfu/sf-spreadtheword</a><br>
_______________________________________________<br>
Ecls-list mailing list<br>
<a href="mailto:Ecls-list@lists.sourceforge.net">Ecls-list@lists.sourceforge.net</a><br>
<a href="https://lists.sourceforge.net/lists/listinfo/ecls-list" target="_blank">https://lists.sourceforge.net/lists/listinfo/ecls-list</a><br>
</blockquote></div><br>