Re: [PATCH v5 11/30] fsmonitor--daemon: implement 'start' command
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Feb 17, 2022, 16:50 UTC
- Message-ID
- <nycvar.QRO.7.76.6.2202171748010.348@tvgsbejvaqbjf.bet>
- In-Reply-To
- <69fc0998286cbc791f199710a68a2028080e1632.1644612979.git.gitgitgadget@gmail.com>
Hi Jeff,
On Fri, 11 Feb 2022, Jeff Hostetler via GitGitGadget wrote:
Show 20 quoted lines
> +static int try_to_start_background_daemon(void)
> +{
> + struct child_process cp = CHILD_PROCESS_INIT;
> + enum start_bg_result sbgr;
> +
> + /*
> + * Before we try to create a background daemon process, see
> + * if a daemon process is already listening. This makes it
> + * easier for us to report an already-listening error to the
> + * console, since our spawn/daemon can only report the success
> + * of creating the background process (and not whether it
> + * immediately exited).
> + */
> + if (fsmonitor_ipc__get_state() == IPC_STATE__LISTENING)
> + die("fsmonitor--daemon is already running '%s'",
> + the_repository->worktree);
> +
> + printf(_("starting fsmonitor-daemon in '%s'\n"),
> + the_repository->worktree);
> + fflush(stdout);Just like for the patch before, my question whether `stdout` or `stderr` is preferable here?
Show 5 quoted lines
> + cp.git_cmd = 1; > + > + strvec_push(&cp.args, "fsmonitor--daemon"); > + strvec_push(&cp.args, "run"); > + strvec_push(&cp.args, "--free-console");
We could call this function `--detached` or `--detach`, too, to indicate the intention.
I am fine with the code as-is, just wanted to make sure that these questions are on record ;-)
Ciao, Dscho