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:
parent
b9743bb75c
commit
031e9a9039
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user