Re: [HACKERS] CVS tip problems
От | Bruce Momjian |
---|---|
Тема | Re: [HACKERS] CVS tip problems |
Дата | |
Msg-id | 200406072246.i57MkU911096@candle.pha.pa.us обсуждение исходный текст |
Ответ на | Re: [HACKERS] CVS tip problems (Tom Lane <tgl@sss.pgh.pa.us>) |
Ответы |
Re: [HACKERS] CVS tip problems
|
Список | pgsql-patches |
Tom Lane wrote: > 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 ... I assume all the callers have to check for NULL, rather than supply a dummy string. However, are you saying that this is more of a debug tool and should never fail to return a usable value? -- Bruce Momjian | http://candle.pha.pa.us pgman@candle.pha.pa.us | (610) 359-1001 + If your life is a hard drive, | 13 Roberts Road + Christ can be your backup. | Newtown Square, Pennsylvania 19073
В списке pgsql-patches по дате отправления: