Re: [HACKERS] CVS tip problems - Mailing list pgsql-patches

From Tom Lane
Subject Re: [HACKERS] CVS tip problems
Date
Msg-id 18391.1086648307@sss.pgh.pa.us
Whole thread Raw
In response to Re: [HACKERS] CVS tip problems  (Bruce Momjian <pgman@candle.pha.pa.us>)
Responses Re: [HACKERS] CVS tip problems  (Bruce Momjian <pgman@candle.pha.pa.us>)
List pgsql-patches
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

pgsql-patches by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: [HACKERS] CVS tip problems
Next
From: Bruce Momjian
Date:
Subject: Re: [HACKERS] CVS tip problems