]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test-clock: fix fd "leak" 2766/head
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 29 Feb 2016 13:03:32 +0000 (08:03 -0500)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 29 Feb 2016 13:03:32 +0000 (08:03 -0500)
CID #1352301.

src/test/test-clock.c

index 92c4f79b98d887a4ef7a0c4214d06a2c467e8cae..b049d97ce7d04235966c53f6d987582db8a2d4c6 100644 (file)
 #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[] = {