kcrash, fork, and stdout/stderr

David Faure faure at kde.org
Sun Dec 3 10:54:21 UTC 2017


I'm trying to fix a bug (caught by CI) where KCrash, with the AutoRestart flag,
restarts the crashing process directly (fork+execve) rather than via kdeinit.

The first process then exits, and whenever the child writes to stderr, it gets 
a SIGPIPE. Oops.

How do I set things up so that the child's stderr is basically what the 
parent's stderr was, in a way that works even if the parent exits?

I'm guessing something with dup() or dup2(), possibly?

-- 
David Faure, faure at kde.org, http://www.davidfaure.fr
Working on KDE Frameworks 5





More information about the Kde-frameworks-devel mailing list