eloop: fix ev_fd_update() to do nothing if the mask does not change

If the new mask is equal to the old mask, we shouldn't change anything.
This improves performance and avoids syscalls when they aren't needed.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
This commit is contained in:
David Herrmann 2012-10-24 17:00:48 +02:00
parent b9743bb75c
commit 031e9a9039

View File

@ -1300,6 +1300,8 @@ int ev_fd_update(struct ev_fd *fd, int mask)
if (!fd)
return -EINVAL;
if (fd->mask == mask)
return 0;
omask = fd->mask;
fd->mask = mask;