[prev in list] [next in list] [prev in thread] [next in thread] 

List:       dm-devel
Subject:    [dm-devel] [PATCH 6/7] fixup "multipath-tools tests: check if /sys/dev/block is non-empty"
From:       mwilck () suse ! com
Date:       2021-03-26 21:29:43
Message-ID: 20210326212944.3136-7-mwilck () suse ! com
[Download RAW message or body]

From: Martin Wilck <mwilck@suse.com>

Don't run closedir() if opendir() failed.

Fixes: "multipath-tools tests: check if /sys/dev/block is non-empty"
Signed-off-by: Martin Wilck <mwilck@suse.com>
---
 tests/devt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/devt.c b/tests/devt.c
index d971302..0ad100a 100644
--- a/tests/devt.c
+++ b/tests/devt.c
@@ -37,8 +37,8 @@ static bool sys_dev_block_exists(void)
 				break;
 			}
 		}
+		closedir(dir);
 	}
-	closedir(dir);
 	return rc;
 }
 
-- 
2.30.1


--
dm-devel mailing list
dm-devel@redhat.com
https://listman.redhat.com/mailman/listinfo/dm-devel

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic