summaryrefslogtreecommitdiffstats
path: root/lib/libc/gen/ttyname.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/gen/ttyname.c')
-rw-r--r--lib/libc/gen/ttyname.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libc/gen/ttyname.c b/lib/libc/gen/ttyname.c
index 39c640e..7ec5429 100644
--- a/lib/libc/gen/ttyname.c
+++ b/lib/libc/gen/ttyname.c
@@ -177,7 +177,7 @@ ttyname(fd)
if (fstat(fd, &sb) || !S_ISCHR(sb.st_mode))
return (NULL);
- if (db = dbopen(_PATH_DEVDB, O_RDONLY, 0, DB_HASH, NULL)) {
+ if ( (db = dbopen(_PATH_DEVDB, O_RDONLY, 0, DB_HASH, NULL)) ) {
memset(&bkey, 0, sizeof(bkey));
bkey.type = S_IFCHR;
bkey.dev = sb.st_rdev;
@@ -206,7 +206,7 @@ oldttyname(fd, sb)
if ((dp = opendir(_PATH_DEV)) == NULL)
return (NULL);
- while (dirp = readdir(dp)) {
+ while ( (dirp = readdir(dp)) ) {
if (dirp->d_fileno != sb->st_ino)
continue;
bcopy(dirp->d_name, buf + sizeof(_PATH_DEV) - 1,
OpenPOWER on IntegriCloud