On 27/09/16 22:14, lmb(a)cloudflare.com wrote:
On 26 September 2016 at 20:48, Hallvard Breien Furuseth
> I think we can skip sigwait() too since the thread will exit when done.
That's what my initial patch did. At least on OS X this leads to the
process receiving SIGPIPE and dying.
OK. I've put a fixed version including that comment in branch
"mdb/its8504-sigpipe" @ <git://git.uio.no/u/hbf/openldap.git>.
We can squash the commits later:
Never clear mc_error, we'd lose failure in the other thread.
It's not mutex-protected, which is OK: If both threads set it,
we'll get one of the errors. LMDB already expects atomic int.
And.. duh, we've forgotten mdb_copy without MDB_CP_COMPACT.
I'll do it later if nobody beats me to it.
Test: Comment out SIGPIPE in mdb_copy.c, then run
bash$ (sleep 1; ./mdb_copy testdb; echo exit $? >&2) | true
Exit values >= 128 are aborts from signals.