Why PG_SETMASK() change errno to 0 when there is an elog() call before or after it? Is it a bug?

From: CNG L <congnanluo(at)gmail(dot)com>
To: "pgsql-bugs(at)lists(dot)postgresql(dot)org" <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: Why PG_SETMASK() change errno to 0 when there is an elog() call before or after it? Is it a bug?
Date: 2019-01-28 02:21:11
Message-ID: CAJ3ejTyRrZZq_Wt0aRnCQbf162SxXNuxRYhYHuhY4g9_A09jYw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

In founction ServerLoop() in code postmaster.c, after select(), we called
PG_SETMASK(). If l add an elog() after PG_SETMASK(), I see errno is reset
to 0 when PG_SETMASK() call suceeded. But the immediately code will
actually check errno from the select() call which now has been overwritten
by PG_SETMASK().

Can someone share some light on this?

Thanks
Congnan

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message 钱学斌 2019-01-28 02:28:46 pgsql bug
Previous Message Andrew Gierth 2019-01-26 04:41:17 Re: psql and readline comments