summaryrefslogtreecommitdiff
path: root/loginutils
diff options
context:
space:
mode:
authorDenys Vlasenko2011-01-22 17:29:53 +0100
committerDenys Vlasenko2011-01-22 17:29:53 +0100
commit006416e8fe63996b86bf614496ce71d83d9b9057 (patch)
tree7566a3ef0e835d657ca6e54775d0e7815b62369c /loginutils
parent2b57b6cd43211e2430c78caa0895f41376f29dc1 (diff)
downloadbusybox-006416e8fe63996b86bf614496ce71d83d9b9057.zip
busybox-006416e8fe63996b86bf614496ce71d83d9b9057.tar.gz
getty: more correct check for O_RDWR
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'loginutils')
-rw-r--r--loginutils/getty.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/loginutils/getty.c b/loginutils/getty.c
index 94c9147..015f077 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");
}
}