summaryrefslogtreecommitdiffstats
path: root/src/basic/reboot-util.h
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2018-02-21 18:48:49 +0100
committerLennart Poettering <lennart@poettering.net>2018-02-22 10:46:26 +0100
commitc01dcddf803a009dd9118dee0873cb9dd1dd02ce (patch)
tree3e83311cf118b02258255558227e909c4b58f4f3 /src/basic/reboot-util.h
parentbasic: split out update_reboot_parameter_and_warn() into its own .c/.h files (diff)
downloadsystemd-c01dcddf803a009dd9118dee0873cb9dd1dd02ce.tar.xz
systemd-c01dcddf803a009dd9118dee0873cb9dd1dd02ce.zip
reboot-util: unify reboot with parameter in a single implementation
So far, we had two implementations of reboot-with-parameter doing pretty much the same. Let's unify that in a generic implementation used by both. This is particulary nice as it unifies all /run/systemd/reboot-param handling in a single .c file.
Diffstat (limited to 'src/basic/reboot-util.h')
-rw-r--r--src/basic/reboot-util.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/basic/reboot-util.h b/src/basic/reboot-util.h
index 6f1d24c1f5..d4aa441290 100644
--- a/src/basic/reboot-util.h
+++ b/src/basic/reboot-util.h
@@ -2,3 +2,11 @@
#pragma once
int update_reboot_parameter_and_warn(const char *parameter);
+
+typedef enum RebootFlags {
+ REBOOT_LOG = 1U << 0, /* log about what we are going to do and all errors */
+ REBOOT_DRY_RUN = 1U << 1, /* return 0 right before actually doing the reboot */
+ REBOOT_FALLBACK = 1U << 2, /* fallback to plain reboot() if argument-based reboot doesn't work, isn't configured or doesn't apply otherwise */
+} RebootFlags;
+
+int reboot_with_parameter(RebootFlags flags);