Commit 3b4ab815 authored by Philippe Gerum's avatar Philippe Gerum
Browse files

evl/poll: return -EBADF on bad fd specification


Signed-off-by: Philippe Gerum's avatarPhilippe Gerum <rpm@xenomai.org>
parent bf89878e
......@@ -206,7 +206,7 @@ static int add_item(struct file *filp, struct poll_group *group,
efilp = evl_get_file(creq->fd);
if (efilp == NULL) {
ret = -EINVAL;
ret = -EBADF;
goto fail_get;
}
......@@ -269,7 +269,7 @@ static int del_item(struct poll_group *group,
item = lookup_item(&group->item_index, creq->fd);
if (item == NULL) {
evl_unlock_kmutex(&group->item_lock);
return -ENOENT;
return -EBADF;
}
rb_erase(&item->rb, &group->item_index);
......@@ -322,7 +322,7 @@ int mod_item(struct poll_group *group,
item = lookup_item(&group->item_index, creq->fd);
if (item == NULL) {
evl_unlock_kmutex(&group->item_lock);
return -ENOENT;
return -EBADF;
}
item->events_polled = events;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment