aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/hw/xfree86/loader/loadmod.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2009-11-17 15:53:57 +0000
committermarha <marha@users.sourceforge.net>2009-11-17 15:53:57 +0000
commit3fce787ffe938bb3e959ff0b3ec231e54d086c76 (patch)
tree198f537b43a34301bf781c67193c572f6743f925 /xorg-server/hw/xfree86/loader/loadmod.c
parent236c69d6034b152598ce35abaf3559b0eaa89c12 (diff)
parent578938f1cdd5a06dd6fa28167d575ec980322a5d (diff)
downloadvcxsrv-3fce787ffe938bb3e959ff0b3ec231e54d086c76.tar.gz
vcxsrv-3fce787ffe938bb3e959ff0b3ec231e54d086c76.tar.bz2
vcxsrv-3fce787ffe938bb3e959ff0b3ec231e54d086c76.zip
svn merge ^/branches/released
Diffstat (limited to 'xorg-server/hw/xfree86/loader/loadmod.c')
-rw-r--r--xorg-server/hw/xfree86/loader/loadmod.c7
1 files changed, 5 insertions, 2 deletions
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;