Print the value of errno when an internal error happened (J.Elsasser).

This commit is contained in:
Juan Jose Garcia Ripoll 2009-01-27 21:48:35 +01:00
parent fb8eb86e72
commit 4ef223694e

View file

@ -29,7 +29,11 @@
void
ecl_internal_error(const char *s)
{
int saved_errno = errno;
printf("\nInternal or unrecoverable error in:\n%s\n", s);
if (saved_errno) {
printf(" [%d: %s]\n", saved_errno, strerror(saved_errno));
}
fflush(stdout);
#ifdef SIGIOT
signal(SIGIOT, SIG_DFL); /* avoid getting into a loop with abort */