waiteventset.c XXX - Mailing list pgsql-hackers

From Robert Haas
Subject waiteventset.c XXX
Date
Msg-id CA+TgmoZq8rLd11osd0Ymu=7bbH-0vwJgbq6yA-b7ofHbOVTDkw@mail.gmail.com
Whole thread Raw
List 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



pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: someone else to do the list of acknowledgments
Next
From: Vik Fearing
Date:
Subject: Re: REPACK and naming