From: | Robert Haas <robertmhaas(at)gmail(dot)com> |
---|---|
To: | PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, "heikki(dot)linnakangas" <heikki(dot)linnakangas(at)iki(dot)fi> |
Subject: | waiteventset.c XXX |
Date: | 2025-09-18 15:25:34 |
Message-ID: | CA+TgmoZq8rLd11osd0Ymu=7bbH-0vwJgbq6yA-b7ofHbOVTDkw@mail.gmail.com |
Views: | Whole Thread | Raw Message | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Hi,
Almost at the very end of waiteventset.c, we have a comment saying
should be sure to do a thing that we don't do:
* NB: be sure to save and restore errno around it. (That's standard practice
* in most signal handlers, of course, but we used to omit it in handlers that
* only set a flag.) XXX
*
As a minor nitpick, the alignment of the last * here is off by a
column, but the real problem is that a few lines later we come to this
function body:
void
WakeupMyProc(void)
{
#if defined(WAIT_USE_SELF_PIPE)
if (waiting)
sendSelfPipeByte();
#else
if (waiting)
kill(MyProcPid, SIGURG);
#endif
}
I submit that we should not have both a comment that says we must save
and restore errno and code that doesn't. Maybe the comment is intended
to imply that the caller should be doing such a save and restore, but
if so, then (a) that's not very clear from the wording and (b) why the
XXX?
I think this is the fault of
https://git.postgresql.org/pg/commitdiff/393e0d2314050576c9c039853fdabe7f685a4f47
--
Robert Haas
EDB: http://www.enterprisedb.com
From | Date | Subject | |
---|---|---|---|
Next Message | Vik Fearing | 2025-09-18 15:27:16 | Re: REPACK and naming |
Previous Message | Bruce Momjian | 2025-09-18 15:21:48 | Re: someone else to do the list of acknowledgments |