Skip to content
Snippets Groups Projects
Commit 40dc3e0d authored by Nat Goodspeed's avatar Nat Goodspeed
Browse files

When constructing a pipe to child stdin on Posix, ignore SIGPIPE.

We can't count on every child process reading everything we try to write to
it. And if the child terminates with WritePipe data still pending, unless we
explicitly suppress it, Posix will hit us with SIGPIPE. That would terminate
the calling process, boom. "Ignoring" it means APR gets the correct errno,
passes it back to us, we log it, etc.
parent 3649eda6
No related branches found
No related tags found
No related merge requests found
...@@ -145,6 +145,15 @@ class WritePipeImpl: public LLProcess::WritePipe ...@@ -145,6 +145,15 @@ class WritePipeImpl: public LLProcess::WritePipe
mConnection = LLEventPumps::instance().obtain("mainloop") mConnection = LLEventPumps::instance().obtain("mainloop")
.listen(LLEventPump::inventName("WritePipe"), .listen(LLEventPump::inventName("WritePipe"),
boost::bind(&WritePipeImpl::tick, this, _1)); boost::bind(&WritePipeImpl::tick, this, _1));
#if ! LL_WINDOWS
// We can't count on every child process reading everything we try to
// write to it. And if the child terminates with WritePipe data still
// pending, unless we explicitly suppress it, Posix will hit us with
// SIGPIPE. That would terminate the viewer, boom. "Ignoring" it means
// APR gets the correct errno, passes it back to us, we log it, etc.
signal(SIGPIPE, SIG_IGN);
#endif
} }
virtual std::ostream& get_ostream() { return mStream; } virtual std::ostream& get_ostream() { return mStream; }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment