mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-07 13:53:24 +00:00
um: sigio: Return error from add_sigio_fd()
If we run out of space, return an error instead of 0. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Richard Weinberger <richard@nod.at>
This commit is contained in:
parent
ef3ba87cb7
commit
d66c91836b
@ -167,15 +167,17 @@ static void update_thread(void)
|
||||
int add_sigio_fd(int fd)
|
||||
{
|
||||
struct pollfd *p;
|
||||
int err = 0, i, n;
|
||||
int err, i, n;
|
||||
|
||||
sigio_lock();
|
||||
for (i = 0; i < all_sigio_fds.used; i++) {
|
||||
if (all_sigio_fds.poll[i].fd == fd)
|
||||
break;
|
||||
}
|
||||
if (i == all_sigio_fds.used)
|
||||
if (i == all_sigio_fds.used) {
|
||||
err = -ENOSPC;
|
||||
goto out;
|
||||
}
|
||||
|
||||
p = &all_sigio_fds.poll[i];
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user