kernel: return an appropriate error when trying to seek things that shouldn't seek
This commit is contained in:
parent
4146aec98d
commit
efba52c3dd
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user