Re: [PATCH v7 3/3] maintenance: add support for systemd timers on Linux
- From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
- Date
- Jul 6, 2021, 20:03 UTC
- Message-ID
- <87eecb5hth.fsf@evledraar.gmail.com>
- In-Reply-To
- <20210702142556.99864-4-lenaic@lhuard.fr>
On Fri, Jul 02 2021, Lénaïc Huard wrote:
[nits]
Show 27 quoted lines
> +#ifdef __linux__
> +
> +static int real_is_systemd_timer_available(void)
> +{
> + struct child_process child = CHILD_PROCESS_INIT;
> +
> + strvec_pushl(&child.args, "systemctl", "--user", "list-timers", NULL);
> + child.no_stdin = 1;
> + child.no_stdout = 1;
> + child.no_stderr = 1;
> + child.silent_exec_failure = 1;
> +
> + if (start_command(&child))
> + return 0;
> + if (finish_command(&child))
> + return 0;
> + return 1;
> +}
> +
> +#else
> +
> +static int real_is_systemd_timer_available(void)
> +{
> + return 0;
> +}
> +
> +#endifDitto the Apple macro, i.e. if most/all of the code complies better to just compile it on all platforms.
In 2/3 we have:
+struct maintenance_start_opts {
+ enum scheduler scheduler;
+};
It's not mentioned (perhaps discussed in previous rounds) but I assumed
the struct would grow in 3/3, but it didn't. Why not pass "enum
scheduler " around directly?