summaryrefslogtreecommitdiff
path: root/sys/compat/hpux/hpux_tty.c
diff options
context:
space:
mode:
authorArtur Grabowski <art@cvs.openbsd.org>2001-10-26 12:03:29 +0000
committerArtur Grabowski <art@cvs.openbsd.org>2001-10-26 12:03:29 +0000
commiteb46b9853439c27012a22a86f3d9139930a9e87a (patch)
tree0668f2d444b8c90d902fc4d94aaf484b512bab93 /sys/compat/hpux/hpux_tty.c
parent322ae2c6b01056eccf34722ee78713e1b3337123 (diff)
- every new fd created by falloc() is marked as larval and should not be used
any anyone. Every caller of falloc matures the fd when it's usable. - Since every lookup in the fd table must now check this flag and all of them do the same thing, move all the necessary checks into a function - fd_getfile.
Diffstat (limited to 'sys/compat/hpux/hpux_tty.c')
-rw-r--r--sys/compat/hpux/hpux_tty.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/sys/compat/hpux/hpux_tty.c b/sys/compat/hpux/hpux_tty.c
index 29f723af781..4dd401ab892 100644
--- a/sys/compat/hpux/hpux_tty.c
+++ b/sys/compat/hpux/hpux_tty.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: hpux_tty.c,v 1.4 1997/04/16 09:18:17 downsj Exp $ */
+/* $OpenBSD: hpux_tty.c,v 1.5 2001/10/26 12:03:27 art Exp $ */
/* $NetBSD: hpux_tty.c,v 1.14 1997/04/01 19:59:05 scottr Exp $ */
/*
@@ -518,8 +518,7 @@ getsettty(p, fdes, com, cmarg)
struct sgttyb sb;
int error;
- if (((unsigned)fdes) >= fdp->fd_nfiles ||
- (fp = fdp->fd_ofiles[fdes]) == NULL)
+ if ((fp = fd_getfile(fdp, fdes)) == NULL)
return (EBADF);
if ((fp->f_flag & (FREAD|FWRITE)) == 0)
return (EBADF);