summaryrefslogtreecommitdiff
path: root/mysys
diff options
context:
space:
mode:
authorunknown <msvensson@shellback.(none)>2006-04-04 09:51:06 +0200
committerunknown <msvensson@shellback.(none)>2006-04-04 09:51:06 +0200
commit90c926d99af7b82e4e32eca26f7733d3a5233006 (patch)
tree0dbf7948ee5050dfd78985a97569aa4929c067a1 /mysys
parent045d42e53f2527a2fdbcef5596355f01ba8a4905 (diff)
parenta1c46189b88158bdabfa864c9a62a41b21e7f0c2 (diff)
downloadmariadb-git-90c926d99af7b82e4e32eca26f7733d3a5233006.tar.gz
Merge shellback.(none):/home/msvensson/mysql/mysql-5.0
into shellback.(none):/home/msvensson/mysql/mysql-5.1 client/mysqltest.c: Auto merged include/config-win.h: Auto merged include/m_ctype.h: Auto merged mysql-test/mysql-test-run.pl: Auto merged mysql-test/r/subselect.result: Auto merged sql/item_func.cc: Auto merged sql/opt_range.cc: Auto merged strings/ctype-bin.c: Auto merged strings/ctype-euc_kr.c: Auto merged strings/ctype-gb2312.c: Auto merged strings/ctype-ucs2.c: Auto merged
Diffstat (limited to 'mysys')
-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__