summaryrefslogtreecommitdiff
path: root/mysys/my_fopen.c
diff options
context:
space:
mode:
authortomas@poseidon.ndb.mysql.com <>2005-05-31 14:37:47 +0200
committertomas@poseidon.ndb.mysql.com <>2005-05-31 14:37:47 +0200
commit5088b28d0958e0ece39a10dd1f242970bafd9575 (patch)
tree7c45fd5243b3cfbcdac69f6a06c9b1ae00ddc11e /mysys/my_fopen.c
parent30def9f3f878111eb504d77b54d287deb698e452 (diff)
parentea5c256b2701c38e151447dd9aa2fcff3070edff (diff)
downloadmariadb-git-5088b28d0958e0ece39a10dd1f242970bafd9575.tar.gz
Merge
Diffstat (limited to 'mysys/my_fopen.c')
-rw-r--r--mysys/my_fopen.c22
1 files changed, 19 insertions, 3 deletions
diff --git a/mysys/my_fopen.c b/mysys/my_fopen.c
index e918b7b0de2..3c6f1b15384 100644
--- a/mysys/my_fopen.c
+++ b/mysys/my_fopen.c
@@ -33,9 +33,25 @@ FILE *my_fopen(const char *FileName, int Flags, myf MyFlags)
DBUG_ENTER("my_fopen");
DBUG_PRINT("my",("Name: '%s' Flags: %d MyFlags: %d",
FileName, Flags, MyFlags));
-
- make_ftype(type,Flags);
- if ((fd = fopen(FileName, type)) != 0)
+ /*
+ if we are not creating, then we need to use my_access to make sure
+ the file exists since Windows doesn't handle files like "com1.sym"
+ very well
+ */
+#ifdef __WIN__
+ if (check_if_legal_filename(FileName))
+ {
+ errno= EACCES;
+ fd= 0;
+ }
+ else
+#endif
+ {
+ make_ftype(type,Flags);
+ fd = fopen(FileName, type);
+ }
+
+ if (fd != 0)
{
/*
The test works if MY_NFILE < 128. The problem is that fileno() is char