]> git.pond.sub.org Git - empserver/commit
Fix crash dump not to mess up streams
authorMarkus Armbruster <armbru@pond.sub.org>
Mon, 9 Mar 2009 20:10:44 +0000 (21:10 +0100)
committerMarkus Armbruster <armbru@pond.sub.org>
Mon, 9 Mar 2009 20:25:46 +0000 (21:25 +0100)
commitb510ee53458fd4ffe70ac26ce848057f64996f5a
tree794e85d5b7b6c093ca8582b8138429f5ef165c76
parent84008cf87065d5582b7d15c2d595b3c6ab796000
Fix crash dump not to mess up streams

Crash dump forks a child to call abort().  abort() may flush or close
streams.  This is unwelcome, because it can mess up streams in the
parent.  Observed with the journal.  Could theoretically also affect
commands info, read, turn, and wire; announcement expiry, and reading
of econfig and schedule.

Fix by using SIGABRT instead.

Note that flushing streams before fork() is not a sufficient fix,
because closing a stream can still move the file descriptor's file
position.  Do it anyway, to ensure any buffered output is visible to
post_crash_dump_hook.
src/server/main.c