diff options
Diffstat (limited to 'ucad.c')
-rw-r--r-- | ucad.c | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -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); } |