chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
e58a127
)
manager: support systems lacking /dev/tty0
author
Lennart Poettering
<lennart@poettering.net>
Fri, 13 Apr 2012 14:53:49 +0000
(16:53 +0200)
committer
Lennart Poettering
<lennart@poettering.net>
Fri, 13 Apr 2012 16:52:52 +0000
(18:52 +0200)
src/core/manager.c
patch
|
blob
|
history
diff --git
a/src/core/manager.c
b/src/core/manager.c
index 2801500f901d80dd1bbc42b77ce0ed8843c1d68e..869c99f5c5685bd719a1c4b965d20cd98c13d118 100644
(file)
--- a/
src/core/manager.c
+++ b/
src/core/manager.c
@@
-141,13
+141,17
@@
static int enable_special_signals(Manager *m) {
assert(m);
assert(m);
- /* Enable that we get SIGINT on control-alt-del */
- if (reboot(RB_DISABLE_CAD) < 0)
+ /* 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)
log_warning("Failed to enable ctrl-alt-del handling: %m");
log_warning("Failed to enable ctrl-alt-del handling: %m");
- if ((fd = open_terminal("/dev/tty0", O_RDWR|O_NOCTTY|O_CLOEXEC)) < 0)
- log_warning("Failed to open /dev/tty0: %m");
- else {
+ fd = open_terminal("/dev/tty0", O_RDWR|O_NOCTTY|O_CLOEXEC);
+ if (fd < 0) {
+ /* Support systems without virtual console */
+ if (fd != -ENOENT)
+ log_warning("Failed to open /dev/tty0: %m");
+ } else {
/* Enable that we get SIGWINCH on kbrequest */
if (ioctl(fd, KDSIGACCEPT, SIGWINCH) < 0)
log_warning("Failed to enable kbrequest handling: %s", strerror(errno));
/* Enable that we get SIGWINCH on kbrequest */
if (ioctl(fd, KDSIGACCEPT, SIGWINCH) < 0)
log_warning("Failed to enable kbrequest handling: %s", strerror(errno));