summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2012-09-17 18:28:40 +0200
committerLennart Poettering <lennart@poettering.net>2012-09-17 19:05:33 +0200
commitc9999773927020a011f1d14ea03ae41431217b89 (patch)
treedeeeff40b419d3ff027cf5214b7414341dbfcebb /src/core
parent669bec5d170c7b6cec5194179d2c14244c06817c (diff)
main: newer kernels return EINVAL if we invoke reboot() in a container lacking perms, deal with it
Diffstat (limited to 'src/core')
-rw-r--r--src/core/manager.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/core/manager.c b/src/core/manager.c
index b0357b71fd..cf06917199 100644
--- a/src/core/manager.c
+++ b/src/core/manager.c
@@ -138,8 +138,9 @@ static int enable_special_signals(Manager *m) {
assert(m);
/* Enable that we get SIGINT on control-alt-del. In containers
- * this will fail with EPERM, so ignore that. */
- if (reboot(RB_DISABLE_CAD) < 0 && errno != EPERM)
+ * this will fail with EPERM (older) or EINVAL (newer), so
+ * ignore that. */
+ if (reboot(RB_DISABLE_CAD) < 0 && errno != EPERM && errno != EINVAL)
log_warning("Failed to enable ctrl-alt-del handling: %m");
fd = open_terminal("/dev/tty0", O_RDWR|O_NOCTTY|O_CLOEXEC);