X-Git-Url: http://git.iain.cx/?a=blobdiff_plain;f=registry.cpp;h=c63821dc7a3dd60a7dfbd010d8bb84ba6666e2ae;hb=c1bc67d13894b1b9456fb85abdabc4dbb5d71bcc;hp=458127cd6fe127c3a4f111aef5336ada0cafa2dc;hpb=e72db63c5e025d3936be5228c8c1ffe4deb3f15d;p=nssm.git diff --git a/registry.cpp b/registry.cpp index 458127c..c63821d 100644 --- a/registry.cpp +++ b/registry.cpp @@ -68,9 +68,24 @@ int create_parameters(nssm_service_t *service) { if (service->kill_console_delay != NSSM_KILL_CONSOLE_GRACE_PERIOD) set_number(key, NSSM_REG_KILL_CONSOLE_GRACE_PERIOD, service->kill_console_delay); if (service->kill_window_delay != NSSM_KILL_WINDOW_GRACE_PERIOD) set_number(key, NSSM_REG_KILL_WINDOW_GRACE_PERIOD, service->kill_window_delay); if (service->kill_threads_delay != NSSM_KILL_THREADS_GRACE_PERIOD) set_number(key, NSSM_REG_KILL_THREADS_GRACE_PERIOD, service->kill_threads_delay); - if (service->stdin_path[0]) set_expand_string(key, NSSM_REG_STDIN, service->stdin_path); - if (service->stdout_path[0]) set_expand_string(key, NSSM_REG_STDOUT, service->stdout_path); - if (service->stderr_path[0]) set_expand_string(key, NSSM_REG_STDERR, service->stderr_path); + if (service->stdin_path[0]) { + set_expand_string(key, NSSM_REG_STDIN, service->stdin_path); + if (service->stdin_sharing != NSSM_STDIN_SHARING) set_createfile_parameter(key, NSSM_REG_STDIN, NSSM_REG_STDIO_SHARING, service->stdin_sharing); + if (service->stdin_disposition != NSSM_STDIN_DISPOSITION) set_createfile_parameter(key, NSSM_REG_STDIN, NSSM_REG_STDIO_DISPOSITION, service->stdin_disposition); + if (service->stdin_flags != NSSM_STDIN_FLAGS) set_createfile_parameter(key, NSSM_REG_STDIN, NSSM_REG_STDIO_FLAGS, service->stdin_flags); + } + if (service->stdout_path[0]) { + set_expand_string(key, NSSM_REG_STDOUT, service->stdout_path); + if (service->stdout_sharing != NSSM_STDOUT_SHARING) set_createfile_parameter(key, NSSM_REG_STDOUT, NSSM_REG_STDIO_SHARING, service->stdout_sharing); + if (service->stdout_disposition != NSSM_STDOUT_DISPOSITION) set_createfile_parameter(key, NSSM_REG_STDOUT, NSSM_REG_STDIO_DISPOSITION, service->stdout_disposition); + if (service->stdout_flags != NSSM_STDOUT_FLAGS) set_createfile_parameter(key, NSSM_REG_STDOUT, NSSM_REG_STDIO_FLAGS, service->stdout_flags); + } + if (service->stderr_path[0]) { + set_expand_string(key, NSSM_REG_STDERR, service->stderr_path); + if (service->stderr_sharing != NSSM_STDERR_SHARING) set_createfile_parameter(key, NSSM_REG_STDERR, NSSM_REG_STDIO_SHARING, service->stderr_sharing); + if (service->stderr_disposition != NSSM_STDERR_DISPOSITION) set_createfile_parameter(key, NSSM_REG_STDERR, NSSM_REG_STDIO_DISPOSITION, service->stderr_disposition); + if (service->stderr_flags != NSSM_STDERR_FLAGS) set_createfile_parameter(key, NSSM_REG_STDERR, NSSM_REG_STDIO_FLAGS, service->stderr_flags); + } /* Environment */ if (service->env) {