From 1eab167a3064e3d302c27edcf311163b953d81ba Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Thu, 3 Jun 1999 16:34:10 +0000 Subject: [PATCH] Fix open(2) return value checking, was NULL for fopen, should be -1 for open --- tgetpass.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tgetpass.c b/tgetpass.c index 4f4f1b994..68d713891 100644 --- a/tgetpass.c +++ b/tgetpass.c @@ -128,7 +128,7 @@ tgetpass(prompt, timeout) * open /dev/tty for reading/writing if possible or use * stdin and stderr instead. */ - if ((input = output = open(_PATH_TTY, O_RDWR)) == NULL) { + if ((input = output = open(_PATH_TTY, O_RDWR)) == -1) { input = STDIN_FILENO; output = STDERR_FILENO; } -- 2.40.0