summaryrefslogtreecommitdiff
path: root/gtk2_ardour/main.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2008-07-25 20:01:48 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2008-07-25 20:01:48 +0000
commitbfb65a6f76e7c3eb32fda8034bce54b14af34c12 (patch)
tree76a621c0c97172b6f570009c10fadb058d4301aa /gtk2_ardour/main.cc
parentd44c033d0fc476086d83e9a544d84789c29d1a2f (diff)
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
Diffstat (limited to 'gtk2_ardour/main.cc')
-rw-r--r--gtk2_ardour/main.cc11
1 files changed, 11 insertions, 0 deletions
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 <cstdlib>
+#include <signal.h>
#include <sigc++/bind.h>
#include <gtkmm/settings.h>
@@ -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) {