summaryrefslogtreecommitdiff
path: root/lib/libc/gen
diff options
context:
space:
mode:
authorChristian Weisgerber <naddy@cvs.openbsd.org>2015-10-12 19:53:59 +0000
committerChristian Weisgerber <naddy@cvs.openbsd.org>2015-10-12 19:53:59 +0000
commita81dbd5a4feba03c2d428d5e8cab3f908a30fd72 (patch)
treed5b978ecefd8e933f793635c33c8115bf692ff04 /lib/libc/gen
parentbef9fbc9c42535416b8c2c7060a9b4d7d640ad2d (diff)
When isatty() was switched to F_ISATTY, the inline copy in ttyname()
was forgotten. Just call isatty(). ok deraadt@
Diffstat (limited to 'lib/libc/gen')
-rw-r--r--lib/libc/gen/ttyname.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/libc/gen/ttyname.c b/lib/libc/gen/ttyname.c
index f54ddf09d30..9e8580c52a8 100644
--- a/lib/libc/gen/ttyname.c
+++ b/lib/libc/gen/ttyname.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ttyname.c,v 1.15 2015/09/12 14:56:50 guenther Exp $ */
+/* $OpenBSD: ttyname.c,v 1.16 2015/10/12 19:53:58 naddy Exp $ */
/*
* Copyright (c) 1988, 1993
* The Regents of the University of California. All rights reserved.
@@ -32,7 +32,6 @@
#include <sys/stat.h>
#include <fcntl.h>
#include <dirent.h>
-#include <termios.h>
#include <db.h>
#include <string.h>
#include <unistd.h>
@@ -68,7 +67,6 @@ int
ttyname_r(int fd, char *buf, size_t len)
{
struct stat sb;
- struct termios ttyb;
DB *db;
DBT data, key;
struct {
@@ -77,7 +75,7 @@ ttyname_r(int fd, char *buf, size_t len)
} bkey;
/* Must be a terminal. */
- if (tcgetattr(fd, &ttyb) < 0)
+ if (!isatty(fd))
return (errno);
/* Must be a character device. */
if (fstat(fd, &sb))