summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2002-06-19 03:44:02 +0000
committerEric Andersen <andersen@codepoet.org>2002-06-19 03:44:02 +0000
commitac4a2b7613359ebacdf4d45f9b6c33233667d02b (patch)
tree4bcb9001b2b595024b9e984237bc09ab8e3e867f
parent88aa307607422895132cc7950bdac5d871d63cb2 (diff)
Oops. Looks like I broke ttyname. Fix it.
-Erik
-rw-r--r--libc/termios/ttyname.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/libc/termios/ttyname.c b/libc/termios/ttyname.c
index 2be496366..695d75ee0 100644
--- a/libc/termios/ttyname.c
+++ b/libc/termios/ttyname.c
@@ -51,7 +51,7 @@ int ttyname_r(int fd, char *buf, size_t buflen)
struct stat st;
noerr = errno;
- if (!buf) {
+ if (buf==NULL) {
noerr = EINVAL;
goto cool_found_it;
}
@@ -72,19 +72,19 @@ int ttyname_r(int fd, char *buf, size_t buflen)
}
/* Lets try /dev/vc first (be devfs compatible) */
- if ( (noerr=__check_dir_for_tty_match("/dev/vc", &st, buf, buflen)))
+ if ( (noerr=__check_dir_for_tty_match("/dev/vc", &st, buf, buflen)) == 0)
goto cool_found_it;
/* Lets try /dev/tts next (be devfs compatible) */
- if ( (noerr=__check_dir_for_tty_match("/dev/tts", &st, buf, buflen)))
+ if ( (noerr=__check_dir_for_tty_match("/dev/tts", &st, buf, buflen)) == 0)
goto cool_found_it;
/* Lets try /dev/pts next */
- if ( (noerr=__check_dir_for_tty_match("/dev/pts", &st, buf, buflen)))
+ if ( (noerr=__check_dir_for_tty_match("/dev/pts", &st, buf, buflen)) == 0)
goto cool_found_it;
/* Lets try walking through /dev last */
- if ( (noerr=__check_dir_for_tty_match("/dev", &st, buf, buflen)))
+ if ( (noerr=__check_dir_for_tty_match("/dev", &st, buf, buflen)) == 0)
goto cool_found_it;
cool_found_it: