From: Bartosz Golaszewski Date: Thu, 23 Feb 2017 10:51:00 +0000 (+0100) Subject: tests: move the closedir() call X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=2c338f198e41bb7383df44ef207c809ab2e2d43f;p=qemu-gpiodev%2Flibgpiod.git tests: move the closedir() call Close the directory immediately after the loop iterating over its entries ends. Signed-off-by: Bartosz Golaszewski --- diff --git a/tests/unit/gpiod-unit.c b/tests/unit/gpiod-unit.c index 51b5945..4e0e6cc 100644 --- a/tests/unit/gpiod-unit.c +++ b/tests/unit/gpiod-unit.c @@ -379,13 +379,12 @@ static void test_prepare(struct gu_chip_descr *descr) die("unable to determine the chip number"); } } + closedir(dir); if (descr->num_chips != current) die("number of requested and detected mockup gpiochips is not the same"); qsort(ctx->chips, ctx->num_chips, sizeof(*ctx->chips), chipcmp); - - closedir(dir); } static void test_teardown(void)