summaryrefslogtreecommitdiff
path: root/lib/libc/gen
diff options
context:
space:
mode:
authorchuck <chuck@cvs.openbsd.org>1996-12-04 23:02:14 +0000
committerchuck <chuck@cvs.openbsd.org>1996-12-04 23:02:14 +0000
commit240884b07d6dbb7d916e21936080c1f8feb4876e (patch)
treeb28ce81228a1f7a7605a2afb01860b732a88e26f /lib/libc/gen
parent62cc1d34821e8afd10698278359aadfc9dbb6b80 (diff)
change open of /dev/tty to "r+" rather than "w+". if /dev/tty is
missing there is no point creating a plain text file to replace it. (related to a problem jkatz had)
Diffstat (limited to 'lib/libc/gen')
-rw-r--r--lib/libc/gen/getpass.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libc/gen/getpass.c b/lib/libc/gen/getpass.c
index 475a7ab20c1..4fdc7f79be0 100644
--- a/lib/libc/gen/getpass.c
+++ b/lib/libc/gen/getpass.c
@@ -32,7 +32,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$OpenBSD: getpass.c,v 1.3 1996/08/19 08:23:57 tholo Exp $";
+static char rcsid[] = "$OpenBSD: getpass.c,v 1.4 1996/12/04 23:02:13 chuck Exp $";
#endif /* LIBC_SCCS and not lint */
#include <termios.h>
@@ -59,7 +59,7 @@ getpass(prompt)
* read and write to /dev/tty if possible; else read from
* stdin and write to stderr.
*/
- if ((outfp = fp = fopen(_PATH_TTY, "w+")) == NULL) {
+ if ((outfp = fp = fopen(_PATH_TTY, "r+")) == NULL) {
outfp = stderr;
fp = stdin;
}