diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/libc/stdlib/posix_pty.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/lib/libc/stdlib/posix_pty.c b/src/lib/libc/stdlib/posix_pty.c index a2025ddbb6..72b5d527cc 100644 --- a/src/lib/libc/stdlib/posix_pty.c +++ b/src/lib/libc/stdlib/posix_pty.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: posix_pty.c,v 1.1 2012/12/03 20:08:33 millert Exp $ */ | 1 | /* $OpenBSD: posix_pty.c,v 1.2 2015/05/11 00:42:54 guenther Exp $ */ |
2 | 2 | ||
3 | /* | 3 | /* |
4 | * Copyright (c) 2012 Todd C. Miller <Todd.Miller@courtesan.com> | 4 | * Copyright (c) 2012 Todd C. Miller <Todd.Miller@courtesan.com> |
@@ -35,7 +35,8 @@ posix_openpt(int oflag) | |||
35 | int fd, mfd = -1; | 35 | int fd, mfd = -1; |
36 | 36 | ||
37 | /* User must specify O_RDWR in oflag. */ | 37 | /* User must specify O_RDWR in oflag. */ |
38 | if (!(oflag & O_RDWR)) { | 38 | if ((oflag & O_ACCMODE) != O_RDWR || |
39 | (oflag & ~(O_ACCMODE | O_NOCTTY)) != 0) { | ||
39 | errno = EINVAL; | 40 | errno = EINVAL; |
40 | return -1; | 41 | return -1; |
41 | } | 42 | } |