Commit d66c9183 authored by Johannes Berg's avatar Johannes Berg Committed by Richard Weinberger

um: sigio: Return error from add_sigio_fd()

If we run out of space, return an error instead of 0.
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
Signed-off-by: default avatarRichard Weinberger <richard@nod.at>
parent ef3ba87c
......@@ -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];
......
Markdown is supported
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