summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Main.cxx11
-rw-r--r--src/classes.h1
2 files changed, 12 insertions, 0 deletions
diff --git a/src/Main.cxx b/src/Main.cxx
index b4bf99a..6d0a490 100644
--- a/src/Main.cxx
+++ b/src/Main.cxx
@@ -49,6 +49,7 @@ class Main extends View, Runnable
private IDirectFBWindow m_window;
private IDirectFBSurface m_surface;
private IDirectFBEventBuffer m_events;
+ private DirectSignalHandler *m_handler;
private Source *m_source;
@@ -92,6 +93,8 @@ class Main extends View, Runnable
/* Initialize DirectFB. */
DirectFB::Init( &argc, &argv );
+ direct_signal_handler_add(SIGPIPE, Main::handle_signal, NULL, &m_handler);
+
if (!m_options.parseCommandLine( argc, argv ))
return;
@@ -538,6 +541,14 @@ class Main extends View, Runnable
else
D_ERROR( "IDiVine interface is null!\n" );
}
+
+ public static DirectSignalHandlerResult
+ handle_signal(int num, void *addr, void *ctx)
+ {
+ exit(13);
+ return DSHR_OK;
+ }
+
};
}
diff --git a/src/classes.h b/src/classes.h
index 2d8228b..33bdbd3 100644
--- a/src/classes.h
+++ b/src/classes.h
@@ -26,6 +26,7 @@ extern "C" {
#include <direct/messages.h>
#include <direct/thread.h>
#include <direct/util.h>
+#include <direct/signals.h>
#include <gfx/convert.h>