Skip to content

Commit

Permalink
Ignore SIGPIPE on all platforms emitting it.
Browse files Browse the repository at this point in the history
* Boost ASIO should do it but unfortunately it seems it does not on OS X and Linux.
  See http://www.boost.org/doc/libs/1_55_0/boost/asio/io_service.hpp
  and http://stackoverflow.com/a/12387971/388803.
* This prevents being killed in the OPI when
  the process can not write to its Tk window anymore.
  (It is also unreasonable to kill the whole process in a multi-VM world)
  • Loading branch information
eregon committed May 18, 2014
1 parent 6ae80fb commit baa705d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions vm/boostenv/main/boostenv.hh
Expand Up @@ -25,6 +25,7 @@
#ifndef MOZART_BOOSTENV_H
#define MOZART_BOOSTENV_H

#include <csignal>
#include <exception>
#include <fstream>

Expand Down Expand Up @@ -114,6 +115,11 @@ BoostEnvironment::BoostEnvironment(const VMStarter& vmStarter) :
vmStarter(vmStarter) {
// Set up a default boot loader
setBootLoader(&defaultBootLoader);

// Ignore SIGPIPE ourselves since Boost does not always do it
#ifdef SIGPIPE
std::signal(SIGPIPE, SIG_IGN);
#endif
}

VMIdentifier BoostEnvironment::addVM(const std::string& app, bool isURL,
Expand Down

0 comments on commit baa705d

Please sign in to comment.