../../../src/util-files.h:61:3: warning: The 1st argument to 'close' is <= -2 but should be >= -1 [unix.StdCLibraryFunctions]
61 | close(*fd);
../../../test/test-quirks.c:66:8: warning: Null pointer passed to 2nd parameter expecting 'nonnull' [core.NonNullParamChecker]
66 | rc = fputs(file_content, fp);
The latter is bogus because we have a litest_assert for this but
somehow this is ignored, so... shrug.
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1111>
static inline void
xclose(int *fd)
{
- if (*fd != -1) {
+ if (*fd > -1) {
close(*fd);
*fd = -1;
}
litest_assert_int_eq(rc, (int)(strlen(dirname) + 16));
fp = fopen(filename, "w+");
+#ifndef __clang_analyzer__
litest_assert_notnull(fp);
+#else
+ assert(fp);
+#endif
rc = fputs(file_content, fp);
litest_assert_errno_success(rc);
fclose(fp);