diff options
author | Andreas Baumann <abaumann@yahoo.com> | 2014-12-04 10:15:55 +0100 |
---|---|---|
committer | Andreas Baumann <abaumann@yahoo.com> | 2014-12-04 10:15:55 +0100 |
commit | d25b982cbe99837668a6928ffd556d678fbdb1c5 (patch) | |
tree | 902e31badcb1fdc9206fd81287c23bbd9b06984a /src | |
parent | d5d78969be2903d30b948ba14353e6d476eb32a8 (diff) | |
download | biruda-d25b982cbe99837668a6928ffd556d678fbdb1c5.tar.gz biruda-d25b982cbe99837668a6928ffd556d678fbdb1c5.tar.bz2 |
fix on Windows
Diffstat (limited to 'src')
-rw-r--r-- | src/NMakefile | 5 | ||||
-rw-r--r-- | src/biruda.c | 2 | ||||
-rw-r--r-- | src/cli.c | 12 | ||||
-rw-r--r-- | src/worker.c | 4 |
4 files changed, 15 insertions, 8 deletions
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" @@ -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 <strings.h> #include <ctype.h> #include <stdarg.h> #include "linenoise.h" #include "http_lib.h" -#endif #include <stdlib.h> #include <string.h> @@ -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; |