Skip to content

Commit

Permalink
devio: Fix returns on devsys ioctls
Browse files Browse the repository at this point in the history
  • Loading branch information
Alan Cox committed Jun 17, 2019
1 parent a0d2353 commit e0c3636
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Kernel/devio.c
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,9 @@ int d_ioctl(uint16_t dev, uint16_t request, char *data)
}

ret = (*dev_tab[major(dev)].dev_ioctl) (minor(dev), request, data);
if (ret == -1 && !udata.u_error) // maybe the ioctl routine might set this?
/* -1 with no error code means 'unknown ioctl'. Turn this into the
right code to save doing it all over */
if (ret == -1 && !udata.u_error)
udata.u_error = ENOTTY;
return ret;
}
Expand Down

0 comments on commit e0c3636

Please sign in to comment.