--- clit18/clit18/clit.c.bak 2004-07-04 16:20:12.000000000 +0300 +++ clit18/clit18/clit.c 2007-09-09 20:38:27.530488746 +0300 @@ -367,7 +367,9 @@ void DisplayErrorText( DWORD dwLastError void lit_error(int what, char * fmt, ...) { va_list ap; unsigned long int w32err; + int saved_errno; + saved_errno = errno; va_start(ap, fmt); printed_error++; @@ -386,8 +388,10 @@ void lit_error(int what, char * fmt, ... vfprintf(stderr,fmt, ap); printf("\n"); - if (what & ERR_LIBC) + if (what & ERR_LIBC) { + errno = saved_errno; perror("\tLIBC reports"); + } #ifdef _MSC_VER if (what & ERR_WIN32) DisplayErrorText(w32err);