kernel: return an appropriate error when trying to seek things that shouldn't seek

This commit is contained in:
K. Lange 2019-12-15 17:01:18 +09:00
parent 4146aec98d
commit efba52c3dd

View File

@ -314,6 +314,7 @@ static int sys_execve(const char * filename, char *const argv[], char *const env
static int sys_seek(int fd, int offset, int whence) {
if (FD_CHECK(fd)) {
if ((FD_ENTRY(fd)->flags & FS_PIPE) || (FD_ENTRY(fd)->flags & FS_CHARDEVICE)) return -ESPIPE;
switch (whence) {
case 0:
FD_OFFSET(fd) = offset;