mirror of
https://gitlab.freedesktop.org/libinput/libei.git
synced 2026-05-15 05:48:07 +02:00
util: only close fds larger than -1 in cleanup_close
This allows us to pass xerrno() results (i.e. negative errnos) and still do the right thing. Assisted-by: Claude:claude-opus-4-6 Part-of: <https://gitlab.freedesktop.org/libinput/libei/-/merge_requests/388>
This commit is contained in:
parent
c6c8f47b43
commit
1efc6d03d1
1 changed files with 1 additions and 1 deletions
|
|
@ -127,7 +127,7 @@ xerrno(int value)
|
|||
static inline int
|
||||
xclose(int fd)
|
||||
{
|
||||
if (fd != -1) {
|
||||
if (fd > -1) {
|
||||
/* Not SYSCALL(), see libei MR!261#note_2131802 */
|
||||
close(fd);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue