summaryrefslogtreecommitdiff
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.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/libc/gen/ttyname.c b/lib/libc/gen/ttyname.c
index 1d01f7b6294..0c965085e76 100644
--- a/lib/libc/gen/ttyname.c
+++ b/lib/libc/gen/ttyname.c
@@ -32,7 +32,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$OpenBSD: ttyname.c,v 1.3 1996/09/15 09:31:07 tholo Exp $";
+static char rcsid[] = "$OpenBSD: ttyname.c,v 1.4 1997/07/09 00:28:25 millert Exp $";
#endif /* LIBC_SCCS and not lint */
#include <sys/types.h>
@@ -68,7 +68,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;
@@ -98,7 +98,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,