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