summaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2010-05-18 03:27:02 +0200
committerLennart Poettering <lennart@poettering.net>2010-05-18 03:27:02 +0200
commit5b2a09037232980ad42ba3611cf194078ae5e546 (patch)
tree94b6289972d79c16e0eea435f9d0c40525a3d2e4 /src/main.c
parent670802d4b1d16c3785a695bea6e13b8bf8c8a822 (diff)
main: if we fail to acquire a terminal for the crash shell, warn but continue
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/main.c b/src/main.c
index bba2975e46..e2d2ab5e64 100644
--- a/src/main.c
+++ b/src/main.c
@@ -138,15 +138,10 @@ _noreturn static void crash(int sig) {
else if (pid == 0) {
int fd, r;
- if ((fd = acquire_terminal("/dev/console", false, true)) < 0) {
+ if ((fd = acquire_terminal("/dev/console", false, true)) < 0)
log_error("Failed to acquire terminal: %s", strerror(-fd));
- _exit(1);
- }
-
- if ((r = make_stdio(fd)) < 0) {
+ else if ((r = make_stdio(fd)) < 0)
log_error("Failed to duplicate terminal fd: %s", strerror(-r));
- _exit(1);
- }
execl("/bin/sh", "/bin/sh", NULL);