From 1f35babc6b2d3433d8855fc65c488a3436254e9d Mon Sep 17 00:00:00 2001 From: Wayne Davison Date: Mon, 21 Feb 2005 00:31:31 +0000 Subject: [PATCH] - For win32: made --no-detach the default for daemon mode. - Added --detach (a --daemon option). --- options.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/options.c b/options.c index 5ff1e9d6..a02e6188 100644 --- a/options.c +++ b/options.c @@ -116,7 +116,12 @@ int default_af_hint = AF_INET; /* Must use IPv4 */ /** Do not go into the background when run as --daemon. Good * for debugging and required for running as a service on W32, * or under Unix process-monitors. **/ -int no_detach = 0; +int no_detach +#if defined _WIN32 || defined __WIN32__ + = 1; +#else + = 0; +#endif int write_batch = 0; int read_batch = 0; @@ -456,6 +461,7 @@ static struct poptOption long_options[] = { {"address", 0, POPT_ARG_STRING, 0, OPT_DAEMON, 0, 0 }, {"config", 0, POPT_ARG_STRING, 0, OPT_DAEMON, 0, 0 }, {"daemon", 0, POPT_ARG_NONE, 0, OPT_DAEMON, 0, 0 }, + {"detach", 0, POPT_ARG_NONE, 0, OPT_DAEMON, 0, 0 }, {"no-detach", 0, POPT_ARG_NONE, 0, OPT_DAEMON, 0, 0 }, {0,0,0,0, 0, 0, 0} }; @@ -491,7 +497,8 @@ static struct poptOption long_daemon_options[] = { {"ipv4", '4', POPT_ARG_VAL, &default_af_hint, AF_INET, 0, 0 }, {"ipv6", '6', POPT_ARG_VAL, &default_af_hint, AF_INET6, 0, 0 }, #endif - {"no-detach", 0, POPT_ARG_NONE, &no_detach, 0, 0, 0 }, + {"detach", 0, POPT_ARG_VAL, &no_detach, 0, 0, 0 }, + {"no-detach", 0, POPT_ARG_VAL, &no_detach, 1, 0, 0 }, {"port", 0, POPT_ARG_INT, &rsync_port, 0, 0, 0 }, {"protocol", 0, POPT_ARG_INT, &protocol_version, 0, 0, 0 }, {"server", 0, POPT_ARG_NONE, &am_server, 0, 0, 0 }, -- 2.34.1