From 26bc9bb629c49c0d5a8668a92c0c7b64626b65c7 Mon Sep 17 00:00:00 2001 From: Matthias Vogelgesang Date: Mon, 16 Oct 2017 09:28:30 +0200 Subject: Fix #7: use glib-unix.h only on UNIX-like OSes --- ucad.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'ucad.c') 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 -#include #include #include #include @@ -25,6 +24,10 @@ #include "uca-net-protocol.h" #include "config.h" +#ifdef HAVE_UNIX +#include +#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); } -- cgit v1.2.3