From 578938f1cdd5a06dd6fa28167d575ec980322a5d Mon Sep 17 00:00:00 2001 From: marha Date: Mon, 16 Nov 2009 13:46:01 +0000 Subject: Update to git master branch of xserver. --- xorg-server/hw/xfree86/loader/loadmod.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'xorg-server/hw/xfree86/loader/loadmod.c') diff --git a/xorg-server/hw/xfree86/loader/loadmod.c b/xorg-server/hw/xfree86/loader/loadmod.c index 0b220f1b6..5b175a546 100644 --- a/xorg-server/hw/xfree86/loader/loadmod.c +++ b/xorg-server/hw/xfree86/loader/loadmod.c @@ -399,8 +399,11 @@ FindModuleInSubdir(const char *dirpath, const char *module) while ((direntry = readdir(dir))) { if (direntry->d_name[0] == '.') continue; - if ((stat(direntry->d_name, &stat_buf) == 0) && S_ISDIR(stat_buf.st_mode)) { - snprintf(tmpBuf, PATH_MAX, "%s/%s", dirpath, direntry->d_name); + snprintf(tmpBuf, PATH_MAX, "%s%s/", dirpath, direntry->d_name); + /* the stat with the appended / fails for normal files, + and works for sub dirs fine, looks a bit strange in strace + but does seem to work */ + if ((stat(tmpBuf, &stat_buf) == 0) && S_ISDIR(stat_buf.st_mode)) { if ((ret = FindModuleInSubdir(tmpBuf, module))) break; continue; -- cgit v1.2.3