summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMartin Pitt <martin.pitt@ubuntu.com>2016-02-29 15:19:10 +0100
committerMartin Pitt <martin.pitt@ubuntu.com>2016-02-29 15:19:10 +0100
commit450e89f6b1e1e3c4d86239287b4049d891da93cb (patch)
treef7d8b13556d1ef176605910499d2c8b84e4a3e8f /src
parent3113d885fe7a64a06701e2da2053638c98d944ad (diff)
parentfe4f8fd1d94f32941722bc637811ad0a6ac32975 (diff)
Merge pull request #2766 from keszybz/coverity
test-clock: fix fd "leak"
Diffstat (limited to 'src')
-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[] = {