From 67bf5013fbcd16c5f5f335dfc16f442745890356 Mon Sep 17 00:00:00 2001 From: aboutros Date: Mon, 27 Feb 2017 17:59:20 +0100 Subject: [PATCH] DISPATCH-644 - Fix daemon mode incorrectly exiting while dispatch router has started Signed-off-by: aboutros --- router/src/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/router/src/main.c b/router/src/main.c index 86ca9d9e6e..69efb3a37c 100644 --- a/router/src/main.c +++ b/router/src/main.c @@ -127,8 +127,8 @@ static void main_process(const char *config_path, const char *python_pkgdir, int if (fd > 2) { /* Daemon mode, fd is one end of a pipe not stdout or stderr */ #ifdef __sun - FILE *file = fdopen(fd, "a+"); - fprintf(file, "ok"); + const char * okResult = "ok"; + write(fd, okResult, (strlen(okResult)+1)); #else dprintf(fd, "ok"); // Success signal #endif