From d25b982cbe99837668a6928ffd556d678fbdb1c5 Mon Sep 17 00:00:00 2001 From: Andreas Baumann Date: Thu, 4 Dec 2014 10:15:55 +0100 Subject: fix on Windows --- src/NMakefile | 5 +++-- src/biruda.c | 2 -- src/cli.c | 12 ++++++++++-- src/worker.c | 4 ++-- 4 files changed, 15 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/NMakefile b/src/NMakefile index b7ff072..65af3b1 100644 --- a/src/NMakefile +++ b/src/NMakefile @@ -42,15 +42,16 @@ LIBS = libConfuse.lib pthreadVC2d.lib nanomsg.lib json-c.lib Ws2_32.lib glib-2.0 all: biruda.exe workertest.exe -biruda.exe: biruda.obj biruda_cmdline.obj master.obj coordinator.obj worker.obj system.obj +biruda.exe: biruda.obj biruda_cmdline.obj master.obj coordinator.obj worker.obj system.obj cli.obj $(LINK) $(LINKFLAGS) $(LIBS) /out:$@ $** biruda_cmdline.obj: biruda_cmdline.c -biruda.obj: biruda.c biruda_cmdline.h master.h coordinator.h worker.h port.h system.h +biruda.obj: biruda.c biruda_cmdline.h master.h coordinator.h worker.h port.h system.h cli.h master.obj: master.c master.h port.h coordinator.obj: coordinator.c coordinator.h port.h system.h worker.obj: worker.c worker.h system.obj: system.c system.h +cli.obj: cli.c cli.h biruda_cmdline.c: biruda.ggo $(GENGETOPT) -F biruda_cmdline --unamed-opts --conf-parser --include-getopt -i $** diff --git a/src/biruda.c b/src/biruda.c index 8e2d9ce..f4ff03a 100644 --- a/src/biruda.c +++ b/src/biruda.c @@ -31,9 +31,7 @@ #include "webserver.h" #endif -#ifndef _WIN32 #include "cli.h" -#endif #include "port.h" diff --git a/src/cli.c b/src/cli.c index 253f104..e21fcbd 100644 --- a/src/cli.c +++ b/src/cli.c @@ -1,12 +1,18 @@ #include "cli.h" -#ifndef _WIN32 +#ifdef _WIN32 +int start_interactive( bool colors, FILE *in ) +{ + fprintf( stderr, "ERROR: Not implemented on Windows!\n" ); + return EXIT_FAILURE; +} + +#else #include #include #include #include "linenoise.h" #include "http_lib.h" -#endif #include #include @@ -309,3 +315,5 @@ int start_interactive( bool colors, FILE *in ) return EXIT_SUCCESS; } + +#endif diff --git a/src/worker.c b/src/worker.c index 70cb64b..99ad6bd 100644 --- a/src/worker.c +++ b/src/worker.c @@ -136,8 +136,8 @@ static void *worker_func( void *thread_data ) wed->err_channel = g_io_channel_unix_new( wed->err ); #endif - g_io_add_watch( wed->out_channel, G_IO_IN | G_IO_HUP, (GIOFunc)watch_output, (gpointer *)wed ); - g_io_add_watch( wed->err_channel, G_IO_IN | G_IO_HUP, (GIOFunc)watch_output, (gpointer *)wed ); + g_io_add_watch( wed->out_channel, GIOCondition( G_IO_IN | G_IO_HUP ), (GIOFunc)watch_output, (gpointer *)wed ); + g_io_add_watch( wed->err_channel, GIOCondition( G_IO_IN | G_IO_HUP ), (GIOFunc)watch_output, (gpointer *)wed ); worker->state = WORKER_STATE_RUNNING; -- cgit v1.2.3-54-g00ecf