summaryrefslogtreecommitdiffstats
path: root/sys/i386
diff options
context:
space:
mode:
Diffstat (limited to 'sys/i386')
-rw-r--r--sys/i386/ibcs2/ibcs2_fcntl.c5
-rw-r--r--sys/i386/ibcs2/ibcs2_ioctl.c3
2 files changed, 4 insertions, 4 deletions
diff --git a/sys/i386/ibcs2/ibcs2_fcntl.c b/sys/i386/ibcs2/ibcs2_fcntl.c
index a54d40a..07b7f41 100644
--- a/sys/i386/ibcs2/ibcs2_fcntl.c
+++ b/sys/i386/ibcs2/ibcs2_fcntl.c
@@ -194,10 +194,11 @@ ibcs2_open(td, uap)
PROC_LOCK(p);
if (!ret && !noctty && SESS_LEADER(p) && !(p->p_flag & P_CONTROLT)) {
struct file *fp;
+ int error;
- fp = ffind_hold(td, td->td_retval[0]);
+ error = fget(td, td->td_retval[0], &fp);
PROC_UNLOCK(p);
- if (fp == NULL)
+ if (error)
return (EBADF);
/* ignore any error, just give it a try */
diff --git a/sys/i386/ibcs2/ibcs2_ioctl.c b/sys/i386/ibcs2/ibcs2_ioctl.c
index a37e116..2755b01 100644
--- a/sys/i386/ibcs2/ibcs2_ioctl.c
+++ b/sys/i386/ibcs2/ibcs2_ioctl.c
@@ -346,8 +346,7 @@ ibcs2_ioctl(td, uap)
struct file *fp;
int error;
- fp = ffind_hold(td, uap->fd);
- if (fp == NULL) {
+ if ((error = fget(td, uap->fd, &fp)) != 0) {
DPRINTF(("ibcs2_ioctl(%d): bad fd %d ", p->p_pid,
SCARG(uap, fd)));
return EBADF;
OpenPOWER on IntegriCloud