udev: use xclose() instead of close()

xclose does the fd == -1 dance which makes analyzers happier.

Co-Authored-by: Claude Code <noreply@anthropic.com>
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1467>
This commit is contained in:
Peter Hutterer 2026-04-16 10:30:30 +10:00 committed by Marge Bot
parent c276c9579e
commit 20b52ffafc
2 changed files with 4 additions and 2 deletions

View file

@ -31,6 +31,7 @@
#include <stdio.h>
#include <unistd.h>
#include "util-files.h"
#include "util-macros.h"
#include "util-prop-parsers.h"
@ -77,7 +78,7 @@ handle_absfuzz(struct udev_device *device)
}
out:
close(fd);
xclose(&fd);
libevdev_free(evdev);
}

View file

@ -30,6 +30,7 @@
#include <stdio.h>
#include <unistd.h>
#include "util-files.h"
#include "util-macros.h"
static void
@ -75,7 +76,7 @@ reset_absfuzz_to_zero(struct udev_device *device)
}
out:
close(fd);
xclose(&fd);
libevdev_free(evdev);
}