Thread (119 messages) 119 messages, 15 authors, 2021-09-27

Re: [PATCH v7 3/3] maintenance: add support for systemd timers on Linux

From: Ævar Arnfjörð Bjarmason <hidden>
Date: 2021-07-06 20:05:36

On Fri, Jul 02 2021, Lénaïc Huard wrote:

[nits]
+#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;
+}
+
+#endif
Ditto 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?
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help