Re: [COMMITTERS] pgsql: Add comments about why errno is set to zero.

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: [COMMITTERS] pgsql: Add comments about why errno is set to zero.
Дата
Msg-id 200512012100.jB1L0FS26208@candle.pha.pa.us
обсуждение исходный текст
Ответы Re: [COMMITTERS] pgsql: Add comments about why errno is set to zero.  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Tom Lane wrote:
> momjian@postgresql.org (Bruce Momjian) writes:
> > Log Message:
> > -----------
> > Add comments about why errno is set to zero.
> 
> These comments seem a bit wrongheaded, since "checking
> LONG_MIN/LONG_MAX" is exactly not what we could do to detect an overflow
> error.

Yea, I noticed the 0 was listed as another value that needs to be
checked.  Should I just change them all to:
errno = 0;  /* avoid checking result for failure */

or should I add a macro to c.h as:
/* Sometimes we need to clear errno so we can check errno * without having to check for a failure value from the
function* call. */    #define CLEAR_ERRNO \\do { \    errno = 0; \\while (0);
 


--  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,
Pennsylvania19073
 


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Greg Stark
Дата:
Сообщение: Re: generalizing the planner knobs
Следующее
От: Tom Lane
Дата:
Сообщение: Re: generalizing the planner knobs