[Ecls-list] Patch: print errno in ecl_internal_error()

Josh Elsasser josh at elsasser.org
Sat Jan 24 21:12:59 UTC 2009

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));
 #ifdef SIGIOT
 	signal(SIGIOT, SIG_DFL); /* avoid getting into a loop with abort */

More information about the ecl-devel mailing list