summaryrefslogtreecommitdiffstats
path: root/ucad.c
diff options
context:
space:
mode:
authorMatthias Vogelgesang <matthias.vogelgesang@kit.edu>2017-10-16 09:28:30 +0200
committerMatthias Vogelgesang <matthias.vogelgesang@kit.edu>2017-10-16 09:28:30 +0200
commit26bc9bb629c49c0d5a8668a92c0c7b64626b65c7 (patch)
treebf04e8306be10882e2a02afc5d93b276396fb8fe /ucad.c
parent7c283feb273c2df98a4b948c8f3005ae5d84c984 (diff)
downloaduca-net-26bc9bb629c49c0d5a8668a92c0c7b64626b65c7.tar.gz
uca-net-26bc9bb629c49c0d5a8668a92c0c7b64626b65c7.tar.bz2
uca-net-26bc9bb629c49c0d5a8668a92c0c7b64626b65c7.tar.xz
uca-net-26bc9bb629c49c0d5a8668a92c0c7b64626b65c7.zip
Fix #7: use glib-unix.h only on UNIX-like OSes
Diffstat (limited to 'ucad.c')
-rw-r--r--ucad.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/ucad.c b/ucad.c
index 07e9157..8b2bd23 100644
--- a/ucad.c
+++ b/ucad.c
@@ -16,7 +16,6 @@
Franklin St, Fifth Floor, Boston, MA 02110, USA */
#include <glib-object.h>
-#include <glib-unix.h>
#include <gio/gio.h>
#include <string.h>
#include <signal.h>
@@ -25,6 +24,10 @@
#include "uca-net-protocol.h"
#include "config.h"
+#ifdef HAVE_UNIX
+#include <glib-unix.h>
+#endif
+
static GMainLoop *loop;
typedef void (*MessageHandler) (GSocketConnection *connection, UcaCamera *camera, gpointer message, GError **error);
@@ -428,7 +431,11 @@ serve (UcaCamera *camera, guint16 port, GError **error)
g_signal_connect (service, "run", G_CALLBACK (run_callback), camera);
loop = g_main_loop_new (NULL, TRUE);
+
+#ifdef HAVE_UNIX
g_unix_signal_add (SIGINT, (GSourceFunc) g_main_loop_quit, loop);
+#endif
+
g_main_loop_run (loop);
}