diff --git a/src/util-strings.c b/src/util-strings.c index b721bd9..d013717 100644 --- a/src/util-strings.c +++ b/src/util-strings.c @@ -28,6 +28,7 @@ #include #include "util-strings.h" +#include "util-io.h" /** * Return the next word in a string pointed to by state before the first @@ -516,7 +517,7 @@ MUNIT_TEST(test_cmdline_as_str) xsnprintf(cmdline, sizeof(cmdline), "/proc/%i/cmdline", getpid()); - int fd = open(cmdline, O_RDONLY); + _cleanup_close_ int fd = open(cmdline, O_RDONLY); munit_assert_int(fd, >=, 0); int len = read(fd, cmdline, sizeof(cmdline) - 1); munit_assert_int(len, >=, 0);