From 1447b7aed93a016f1b762bf1631548aefc7ae2ad Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Tue, 17 Oct 2006 01:14:01 +0000 Subject: r19359: More portable way of figuring out whether something is a directory (This used to be commit 96dff03a2b357f937daa4296d4cedd0249f68ece) --- source4/torture/subunit.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'source4/torture/subunit.c') diff --git a/source4/torture/subunit.c b/source4/torture/subunit.c index f7c14aa023..2a1e6e1cb6 100644 --- a/source4/torture/subunit.c +++ b/source4/torture/subunit.c @@ -59,12 +59,14 @@ bool torture_subunit_load_testsuites(const char *directory, bool recursive, if (entry->d_name[0] == '.') continue; - if (!recursive && entry->d_type & DT_DIR) + filename = talloc_asprintf(NULL, "%s/%s", directory, entry->d_name); + + if (!recursive && directory_exist(filename)) { + talloc_free(filename); continue; + } - filename = talloc_asprintf(NULL, "%s/%s", directory, entry->d_name); - - if (entry->d_type & DT_DIR) { + if (directory_exist(filename)) { child = torture_find_suite(parent, entry->d_name); exists = (child != NULL); if (child == NULL) -- cgit