posix: eventfd: Fix unsetting internal flags in ioctl
Commit e6eb0a705b
("posix: eventfd: revise locking, signaling, and
allocation") introduced a regression where the internal flags of an
event file descriptor would be erased when calling the F_SETFL ioctl
operation.
This includes the flag EFD_IN_USE_INTERNAL which determines whether
this file descriptor has been opened, thus effectively closing the
eventfd whenever one tries to change a flag.
Signed-off-by: Celina Sophie Kalus <hello@celinakalus.de>
This commit is contained in:
parent
12f48fe896
commit
5bd86eaddb
1 changed files with 3 additions and 1 deletions
|
@ -247,7 +247,9 @@ static int eventfd_ioctl_op(void *obj, unsigned int request, va_list args)
|
||||||
errno = EINVAL;
|
errno = EINVAL;
|
||||||
ret = -1;
|
ret = -1;
|
||||||
} else {
|
} else {
|
||||||
efd->flags = flags;
|
int prev_flags = efd->flags & ~EFD_FLAGS_SET_INTERNAL;
|
||||||
|
|
||||||
|
efd->flags = flags | prev_flags;
|
||||||
ret = 0;
|
ret = 0;
|
||||||
}
|
}
|
||||||
} break;
|
} break;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue