X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=src%2Fmain.c;h=e2d2ab5e647ad83bf8cf2442f4982cd6a1eff5bd;hp=bba2975e467fea4112bc95a4ba7bd9ad6872310a;hb=5b2a09037232980ad42ba3611cf194078ae5e546;hpb=670802d4b1d16c3785a695bea6e13b8bf8c8a822;ds=sidebyside diff --git a/src/main.c b/src/main.c index bba2975e4..e2d2ab5e6 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);