[git commit] cttyhack: fail gracefully if the device node is missing

Denys Vlasenko vda.linux at googlemail.com
Wed Jul 13 07:30:36 UTC 2011


commit: http://git.busybox.net/busybox/commit/?id=43a668b2eef5f77d1fe0bee1289cea6649fa793d
branch: http://git.busybox.net/busybox/commit/?id=refs/heads/master

Signed-off-by: Kevin Cernekee <cernekee at gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux at googlemail.com>
---
 shell/cttyhack.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/shell/cttyhack.c b/shell/cttyhack.c
index 522a1ba..4261289 100644
--- a/shell/cttyhack.c
+++ b/shell/cttyhack.c
@@ -146,7 +146,9 @@ int cttyhack_main(int argc UNUSED_PARAM, char **argv)
 			goto ret;
 		} while (0);
 
-		fd = xopen(console, O_RDWR);
+		fd = open_or_warn(console, O_RDWR);
+		if (fd < 0)
+			goto ret;
 		//bb_error_msg("switching to '%s'", console);
 		dup2(fd, 0);
 		dup2(fd, 1);
-- 
1.7.3.4



More information about the busybox-cvs mailing list