aboutsummaryrefslogtreecommitdiff
path: root/stand/libsa/ioctl.c
diff options
context:
space:
mode:
Diffstat (limited to 'stand/libsa/ioctl.c')
-rw-r--r--stand/libsa/ioctl.c22
1 files changed, 10 insertions, 12 deletions
diff --git a/stand/libsa/ioctl.c b/stand/libsa/ioctl.c
index 807b308e5e50..7363236ada0e 100644
--- a/stand/libsa/ioctl.c
+++ b/stand/libsa/ioctl.c
@@ -32,30 +32,30 @@
* SUCH DAMAGE.
*
* @(#)ioctl.c 8.1 (Berkeley) 6/11/93
- *
+ *
*
* Copyright (c) 1989, 1990, 1991 Carnegie Mellon University
* All Rights Reserved.
*
* Author: Alessandro Forin
- *
+ *
* Permission to use, copy, modify and distribute this software and its
* documentation is hereby granted, provided that both the copyright
* notice and this permission notice appear in all copies of the
* software, derivative works or modified versions, and any portions
* thereof, and that both notices appear in supporting documentation.
- *
+ *
* CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
* CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
* ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
- *
+ *
* Carnegie Mellon requests users of this software to return to
- *
+ *
* Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
* School of Computer Science
* Carnegie Mellon University
* Pittsburgh PA 15213-3890
- *
+ *
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*/
@@ -66,14 +66,12 @@ __FBSDID("$FreeBSD$");
#include "stand.h"
int
-ioctl(fd, cmd, arg)
- int fd;
- u_long cmd;
- char *arg;
+ioctl(int fd, u_long cmd, char *arg)
{
- struct open_file *f = &files[fd];
+ struct open_file *f;
- if ((unsigned)fd >= SOPEN_MAX || f->f_flags == 0) {
+ f = fd2open_file(fd);
+ if (f == NULL || f->f_flags == 0) {
errno = EBADF;
return (-1);
}