X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=test%2Fcontext.c;h=13d47a1a687ba00214c5b4ad1a762316f77055ce;hb=f967d46b65329dd1a03151d5904ffe40e8467b2c;hp=150491b09031a6749058b09aedef6fdd1af8b1ac;hpb=40aab05e77d746beca4119bb254e534e449f9130;p=platform%2Fupstream%2Flibxkbcommon.git diff --git a/test/context.c b/test/context.c index 150491b..13d47a1 100644 --- a/test/context.c +++ b/test/context.c @@ -28,9 +28,9 @@ #include "test.h" #include "context.h" -#include #include -#include +#include +#include /* keeps a cache of all makedir/maketmpdir directories so we can free and * rmdir them in one go, see unmakedirs() */ @@ -150,15 +150,16 @@ test_config_root_include_path_fallback(void) const char *xkbdir = DFLT_XKB_CONFIG_ROOT; const char *context_path; int nincludes; - DIR *dir; /* quick and dirty check that the default directory exists. * It may not on a vanilla test box if we just run the test * suite, so where it's not there just skip this test. */ - dir = opendir(xkbdir); - if (!dir) + struct stat stat_buf; + int err = stat(xkbdir, &stat_buf); + if (err != 0) + return; + if (!S_ISDIR(stat_buf.st_mode)) return; - closedir(dir); buffer_env("XKB_CONFIG_ROOT"); buffer_env("HOME");