]> granicus.if.org Git - sudo/commitdiff
Fix open(2) return value checking, was NULL for fopen, should be -1 for open
authorTodd C. Miller <Todd.Miller@courtesan.com>
Thu, 3 Jun 1999 16:34:10 +0000 (16:34 +0000)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Thu, 3 Jun 1999 16:34:10 +0000 (16:34 +0000)
tgetpass.c

index 4f4f1b9945bc099456b912a08c850e44e7842c9a..68d7138914a19410101ad2e6b7d02f7af2a6c578 100644 (file)
@@ -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;
     }