r19359: More portable way of figuring out whether something is a directory
authorJelmer Vernooij <jelmer@samba.org>
Tue, 17 Oct 2006 01:14:01 +0000 (01:14 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 19:21:16 +0000 (14:21 -0500)
(This used to be commit 96dff03a2b357f937daa4296d4cedd0249f68ece)

source4/torture/subunit.c

index f7c14aa0238517b47dabefdeafd6736f0972ee92..2a1e6e1cb65426e0b7d9fcd5b26de91d4546e3c2 100644 (file)
@@ -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)