summaryrefslogtreecommitdiffstats
path: root/src/main.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2004-06-11 21:30:16 +0000
committerLennart Poettering <lennart@poettering.net>2004-06-11 21:30:16 +0000
commit7dfeb1fc745757f1c2b7bf43bae80cf0f49fc9a6 (patch)
tree2876784e67ed6cf3974e7b06771835a8a4162979 /src/main.c
parentaae40dcea260296d7d02d185b42f9275f34cb238 (diff)
make the whole stuff run and clean it self up again
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@8 fefdeb5f-60dc-0310-8127-8f9354f1896f
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/main.c b/src/main.c
index 0785b39c..436dd30b 100644
--- a/src/main.c
+++ b/src/main.c
@@ -1,3 +1,5 @@
+#include <stdio.h>
+#include <signal.h>
#include <stddef.h>
#include <assert.h>
#include <ltdl.h>
@@ -6,6 +8,11 @@
#include "mainloop.h"
#include "module.h"
+static void signal_callback(struct mainloop_source *m, int sig, void *userdata) {
+ mainloop_quit(mainloop_source_get_mainloop(m), -1);
+ fprintf(stderr, "Got signal.\n");
+}
+
int main(int argc, char *argv[]) {
struct mainloop *m;
struct core *c;
@@ -19,6 +26,9 @@ int main(int argc, char *argv[]) {
c = core_new(m);
assert(c);
+ mainloop_source_new_signal(m, SIGINT, signal_callback, NULL);
+ signal(SIGPIPE, SIG_IGN);
+
module_load(c, "sink-pipe", NULL);
module_load(c, "protocol-simple-tcp", NULL);