From 1a545a1fa03f00a95c363f4fbb413bc804c70a10 Mon Sep 17 00:00:00 2001 From: Jeff Hostetler Date: Wed, 29 Sep 2021 15:14:13 -0400 Subject: [PATCH] fixup! fsmonitor--daemon: background daemon must free the console on windows This reverts commit e3fc6efce3848c00fc2771f12b0800d8f442507b. Signed-off-by: Jeff Hostetler --- builtin/fsmonitor--daemon.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/builtin/fsmonitor--daemon.c b/builtin/fsmonitor--daemon.c index d9a9b8e6b8..a4e3f6e309 100644 --- a/builtin/fsmonitor--daemon.c +++ b/builtin/fsmonitor--daemon.c @@ -1302,7 +1302,7 @@ done: return err; } -static int try_to_run_foreground_daemon(int free_console) +static int try_to_run_foreground_daemon(void) { /* * Technically, we don't need to probe for an existing daemon @@ -1320,11 +1320,6 @@ static int try_to_run_foreground_daemon(int free_console) the_repository->worktree); fflush(stdout); -#ifdef GIT_WINDOWS_NATIVE - if (free_console) - FreeConsole(); -#endif - return !!fsmonitor_run_daemon(); } @@ -1356,7 +1351,6 @@ static int spawn_fsmonitor(pid_t *pid) strvec_push(&args, git_exe); strvec_push(&args, "fsmonitor--daemon"); strvec_push(&args, "run"); - strvec_push(&args, "--free-console"); strvec_pushf(&args, "--ipc-threads=%d", fsmonitor__ipc_threads); *pid = mingw_spawnvpe(args.v[0], args.v, NULL, NULL, in, out, out); @@ -1520,10 +1514,8 @@ static int try_to_start_background_daemon(void) int cmd_fsmonitor__daemon(int argc, const char **argv, const char *prefix) { const char *subcmd; - int free_console = 0; struct option options[] = { - OPT_BOOL(0, "free-console", &free_console, N_("free console")), OPT_INTEGER(0, "ipc-threads", &fsmonitor__ipc_threads, N_("use ipc worker threads")), @@ -1567,7 +1559,7 @@ int cmd_fsmonitor__daemon(int argc, const char **argv, const char *prefix) return !!try_to_start_background_daemon(); if (!strcmp(subcmd, "run")) - return !!try_to_run_foreground_daemon(free_console); + return !!try_to_run_foreground_daemon(); if (!strcmp(subcmd, "stop")) return !!do_as_client__send_stop();