mirror of
https://github.com/drasko/codezero.git
synced 2026-03-17 09:41:49 +01:00
fd wasn't returned in reorganised sys_open. Fixed.
This commit is contained in:
@@ -129,6 +129,7 @@ int sys_open(l4id_t sender, const char *pathname, int flags, unsigned int mode)
|
||||
|
||||
/* Get a new fd */
|
||||
BUG_ON((fd = id_new(task->fdpool)) < 0);
|
||||
retval = fd;
|
||||
|
||||
/* Assign the new fd with the vnode's number */
|
||||
task->fd[fd] = v->vnum;
|
||||
@@ -339,6 +340,11 @@ int sys_readdir(l4id_t sender, int fd, void *buf, int count)
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (fd < 0 || fd > TASK_OFILES_MAX) {
|
||||
l4_ipc_return(-EBADF);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Convert fd to vnum. */
|
||||
BUG_ON((vnum = t->fd[fd]) < 0);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user