if (ptr->length >= 0 &&
ptr->length <= ptr->buffer_length) {
long length = ptr->buffer_length - ptr->length;
- ECALL(fd_copyout(ptr->data, ptr->kernel_data,
- length));
+ ret = fd_copyout(ptr->data, ptr->kernel_data,
+ length);
+ if (ret)
+ return ret;
}
}
ptr = ptr->next;
return -ENOMEM;
ptr->buffer_length = ptr->length;
}
- if (ptr->flags & FD_RAW_WRITE)
- ECALL(fd_copyin(ptr->data, ptr->kernel_data,
- ptr->length));
+ if (ptr->flags & FD_RAW_WRITE) {
+ ret = fd_copyin(ptr->data, ptr->kernel_data,
+ ptr->length);
+ if (ret)
+ return ret;
+ }
rcmd = &(ptr->next);
if (!(ptr->flags & FD_RAW_MORE))
return 0;
if (lock_fdc(drive, 1))
return -EINTR;
- if (cmd != FDDEFPRM)
+ if (cmd != FDDEFPRM) {
/* notice a disk change immediately, else
* we lose our settings immediately*/
- CALL(poll_drive(1, FD_RAW_NEED_DISK));
+ if (poll_drive(1, FD_RAW_NEED_DISK) == -EINTR)
+ return -EINTR;
+ }
oldStretch = g->stretch;
user_params[drive] = *g;
if (buffer_drive == drive)
else {
if (lock_fdc(drive, 0))
return -EINTR;
- CALL(poll_drive(0, 0));
+ if (poll_drive(0, 0) == -EINTR)
+ return -EINTR;
process_fd_request();
*g = current_type[drive];
}
return -EINVAL;
/* convert the old style command into a new style command */
- ECALL(normalize_ioctl(&cmd, &size));
+ ret = normalize_ioctl(&cmd, &size);
+ if (ret)
+ return ret;
/* permission checks */
if (((cmd & 0x40) && !FD_IOCTL_ALLOWED) ||
/* copyin */
memset(&inparam, 0, sizeof(inparam));
- if (_IOC_DIR(cmd) & _IOC_WRITE)
- ECALL(fd_copyin((void __user *)param, &inparam, size));
+ if (_IOC_DIR(cmd) & _IOC_WRITE) {
+ ret = fd_copyin((void __user *)param, &inparam, size);
+ if (ret)
+ return ret;
+ }
switch (cmd) {
case FDEJECT:
case FDDEFPRM:
return set_geometry(cmd, &inparam.g, drive, type, bdev);
case FDGETPRM:
- ECALL(get_floppy_geometry(drive, type,
+ ret = get_floppy_geometry(drive, type,
(struct floppy_struct **)
- &outparam));
+ &outparam);
+ if (ret)
+ return ret;
break;
case FDMSGON:
UDP->flags |= FTD_MSG;
case FDFMTBEG:
if (lock_fdc(drive, 1))
return -EINTR;
- CALL(poll_drive(1, FD_RAW_NEED_DISK));
+ if (poll_drive(1, FD_RAW_NEED_DISK) == -EINTR)
+ return -EINTR;
ret = UDRS->flags;
process_fd_request();
if (ret & FD_VERIFY)
case FDPOLLDRVSTAT:
if (lock_fdc(drive, 1))
return -EINTR;
- CALL(poll_drive(1, FD_RAW_NEED_DISK));
+ if (poll_drive(1, FD_RAW_NEED_DISK) == -EINTR)
+ return -EINTR;
process_fd_request();
/* fall through */
case FDGETDRVSTAT:
if (lock_fdc(drive, 1))
return -EINTR;
set_floppy(drive);
- CALL(i = raw_cmd_ioctl(cmd, (void __user *)param));
+ i = raw_cmd_ioctl(cmd, (void __user *)param);
+ if (i == -EINTR)
+ return -EINTR;
process_fd_request();
return i;
case FDTWADDLE: