From bfb65a6f76e7c3eb32fda8034bce54b14af34c12 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Fri, 25 Jul 2008 20:01:48 +0000 Subject: [PATCH] add SIGPIPE handler to catch JACK going away, etc git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@3648 d708f5d6-7413-0410-9779-e7cbd77b26cf --- gtk2_ardour/main.cc | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/gtk2_ardour/main.cc b/gtk2_ardour/main.cc index c2337f64ec..0252cb1986 100644 --- a/gtk2_ardour/main.cc +++ b/gtk2_ardour/main.cc @@ -18,6 +18,7 @@ */ #include +#include #include #include @@ -223,6 +224,12 @@ fixup_bundle_environment () #endif +static void +sigpipe_handler (int sig) +{ + cerr << _("SIGPIPE received - JACK has probably died") << endl; +} + #ifdef VST_SUPPORT /* this is called from the entry point of a wine-compiled executable that is linked against gtk2_ardour built @@ -300,6 +307,10 @@ int main (int argc, char* argv[]) PBD::ID::init (); + if (::signal (SIGPIPE, sigpipe_handler)) { + cerr << _("Cannot install SIGPIPE error handler") << endl; + } + try { ui = new ARDOUR_UI (&argc, &argv); } catch (failed_constructor& err) {