summaryrefslogtreecommitdiff
path: root/mysys/my_lib.c
diff options
context:
space:
mode:
authormsvensson@shellback.(none) <>2006-03-23 23:09:34 +0100
committermsvensson@shellback.(none) <>2006-03-23 23:09:34 +0100
commitde6b1b777c92d5bbba10400304b0e6ecef94e817 (patch)
treeeb0621a921c1dc071414dca29960377ff5bc2f1f /mysys/my_lib.c
parent7162b65c24f0067da0f5a1c641bd3adc85560be3 (diff)
downloadmariadb-git-de6b1b777c92d5bbba10400304b0e6ecef94e817.tar.gz
Bug#18474 Unlistable directories yield no info from information_schema, part2
- Make the windows implementation of 'my_dir' behave like the default implementation
Diffstat (limited to 'mysys/my_lib.c')
-rw-r--r--mysys/my_lib.c26
1 files changed, 17 insertions, 9 deletions
diff --git a/mysys/my_lib.c b/mysys/my_lib.c
index 4ca343064d3..522fa56cbf1 100644
--- a/mysys/my_lib.c
+++ b/mysys/my_lib.c
@@ -398,14 +398,6 @@ MY_DIR *my_dir(const char *path, myf MyFlags)
tmp_file[2]='*';
tmp_file[3]='\0';
-#ifdef __BORLANDC__
- if ((handle= findfirst(tmp_path,&find,0)) == -1L)
- goto error;
-#else
- if ((handle=_findfirst(tmp_path,&find)) == -1L)
- goto error;
-#endif
-
if (!(buffer= my_malloc(ALIGN_SIZE(sizeof(MY_DIR)) +
ALIGN_SIZE(sizeof(DYNAMIC_ARRAY)) +
sizeof(MEM_ROOT), MyFlags)))
@@ -425,7 +417,23 @@ MY_DIR *my_dir(const char *path, myf MyFlags)
/* MY_DIR structure is allocated and completly initialized at this point */
result= (MY_DIR*)buffer;
-
+
+#ifdef __BORLANDC__
+ if ((handle= findfirst(tmp_path,&find,0)) == -1L)
+#else
+ if ((handle=_findfirst(tmp_path,&find)) == -1L)
+#endif
+ {
+ DBUG_PRINT("info", ("find_first returned error"));
+ if (errno != EINVAL)
+ goto error;
+ /*
+ Could not read the directory, no read access.
+ Probably because by "chmod -r".
+ continue and return zero files in dir
+ */
+ }
+
do
{
#ifdef __BORLANDC__