SVN commit 1039764 by ossi: clean up event loop of gcc invocation the sigchld handler which sets a flag is inherently racy (that's what pselect() was introduced for, but see the linux man page for it). so instead use a nicely synchronizing death pipe. also, consolidate the two event loops into one. as the code is running in a short-lived child, i made it lazy about freeing resources for legibility's sake. M +232 -209 workit.cpp http://websvn.kde.org/?view=rev&revision=1039764