From 2c338f198e41bb7383df44ef207c809ab2e2d43f Mon Sep 17 00:00:00 2001 From: Bartosz Golaszewski Date: Thu, 23 Feb 2017 11:51:00 +0100 Subject: [PATCH] tests: move the closedir() call Close the directory immediately after the loop iterating over its entries ends. Signed-off-by: Bartosz Golaszewski --- tests/unit/gpiod-unit.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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) -- 2.30.2