From 006416e8fe63996b86bf614496ce71d83d9b9057 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Sat, 22 Jan 2011 17:29:53 +0100 Subject: getty: more correct check for O_RDWR Signed-off-by: Denys Vlasenko --- loginutils/getty.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/loginutils/getty.c b/loginutils/getty.c index 94c9147ab..015f077d6 100644 --- a/loginutils/getty.c +++ b/loginutils/getty.c @@ -268,7 +268,7 @@ static void open_tty(const char *tty) * Standard input should already be connected to an open port. Make * sure it is open for read/write. */ - if ((fcntl(0, F_GETFL) & O_RDWR) != O_RDWR) + if ((fcntl(0, F_GETFL) & (O_RDWR|O_RDONLY|O_WRONLY)) != O_RDWR) bb_error_msg_and_die("stdin is not open for read/write"); } } -- cgit v1.2.3