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.c21
1 files changed, 8 insertions, 13 deletions
diff --git a/stand/libsa/ioctl.c b/stand/libsa/ioctl.c
index 7363236ada0e..cc592a454812 100644
--- a/stand/libsa/ioctl.c
+++ b/stand/libsa/ioctl.c
@@ -31,8 +31,6 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * @(#)ioctl.c 8.1 (Berkeley) 6/11/93
- *
*
* Copyright (c) 1989, 1990, 1991 Carnegie Mellon University
* All Rights Reserved.
@@ -60,13 +58,10 @@
* rights to redistribute these changes.
*/
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
#include "stand.h"
int
-ioctl(int fd, u_long cmd, char *arg)
+ioctl(int fd, u_long cmd, void *arg)
{
struct open_file *f;
@@ -75,12 +70,12 @@ ioctl(int fd, u_long cmd, char *arg)
errno = EBADF;
return (-1);
}
- if (f->f_flags & F_RAW) {
+ if (f->f_dev == NULL)
+ errno = EIO;
+ else
errno = (f->f_dev->dv_ioctl)(f, cmd, arg);
- if (errno)
- return (-1);
- return (0);
- }
- errno = EIO;
- return (-1);
+
+ if (errno != 0)
+ return (-1);
+ return (0);
}