From fe4f8fd1d94f32941722bc637811ad0a6ac32975 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Mon, 29 Feb 2016 08:03:32 -0500 Subject: [PATCH] test-clock: fix fd "leak" CID #1352301. --- src/test/test-clock.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/test/test-clock.c b/src/test/test-clock.c index 92c4f79..b049d97 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[] = { -- 2.7.4