mirror of
https://github.com/MariaDB/server.git
synced 2026-05-15 19:37:16 +02:00
Merge mysql.com:/home/bkroot/mysql-4.1 into mysql.com:/home/bk/c4944-4.1
This commit is contained in:
commit
b36f9f2eed
7 changed files with 42 additions and 4 deletions
|
|
@ -33,9 +33,22 @@ 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 (! (Flags & O_CREAT) && my_access(FileName, F_OK))
|
||||
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
|
||||
|
|
|
|||
|
|
@ -46,6 +46,13 @@ File my_open(const char *FileName, int Flags, myf MyFlags)
|
|||
DBUG_PRINT("my",("Name: '%s' Flags: %d MyFlags: %d",
|
||||
FileName, Flags, MyFlags));
|
||||
#if defined(MSDOS) || defined(__WIN__) || defined(__EMX__) || defined(OS2)
|
||||
/*
|
||||
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
|
||||
*/
|
||||
if (! (Flags & O_CREAT) && my_access(FileName, F_OK))
|
||||
return -1;
|
||||
if (Flags & O_SHARE)
|
||||
fd = sopen((my_string) FileName, (Flags & ~O_SHARE) | O_BINARY, SH_DENYNO,
|
||||
MY_S_IREAD | MY_S_IWRITE);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue