From fe4f8fd1d94f32941722bc637811ad0a6ac32975 Mon Sep 17 00:00:00 2001 From: Zbigniew Jędrzejewski-Szmek Date: Mon, 29 Feb 2016 08:03:32 -0500 Subject: test-clock: fix fd "leak" CID #1352301. --- src/test/test-clock.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/test') diff --git a/src/test/test-clock.c b/src/test/test-clock.c index 92c4f79b98..b049d97ce7 100644 --- a/src/test/test-clock.c +++ b/src/test/test-clock.c @@ -20,17 +20,18 @@ #include #include -#include "macro.h" +#include "clock-util.h" +#include "fd-util.h" #include "fileio.h" #include "log.h" -#include "clock-util.h" +#include "macro.h" static void test_clock_is_localtime(void) { char adjtime[] = "/tmp/test-adjtime.XXXXXX"; - int fd; + _cleanup_close_ int fd = -1; FILE* f; - const struct scenario { + static const struct scenario { const char* contents; int expected_result; } scenarios[] = { -- cgit v1.2.3-54-g00ecf