summaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2016-02-29 08:03:32 -0500
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2016-02-29 08:03:32 -0500
commitfe4f8fd1d94f32941722bc637811ad0a6ac32975 (patch)
treef7d8b13556d1ef176605910499d2c8b84e4a3e8f /src/test
parent3113d885fe7a64a06701e2da2053638c98d944ad (diff)
test-clock: fix fd "leak"
CID #1352301.
Diffstat (limited to 'src/test')
-rw-r--r--src/test/test-clock.c9
1 files changed, 5 insertions, 4 deletions
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 <unistd.h>
#include <fcntl.h>
-#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[] = {