Bruce Momjian <pgman@candle.pha.pa.us> writes:
> ! #ifdef STRERROR_R_INT
> ! /* SUSv3 version */
> ! if (strerror_r(errnum, strerrbuf, buflen) == 0)
> ! return strerrbuf;
> ! else
> ! return NULL;
> ! #else
This code will dump core if strerror_r ever fails, which seems like
a bad idea. I suggest that it be like
! if (strerror_r(errnum, strerrbuf, buflen) == 0)
! return strerrbuf;
! else
! return "strerror_r failed";
which at least gives a hint of the problem ...
regards, tom lane