Commit 232e9d3c authored by kaa@kaamos.(none)'s avatar kaa@kaamos.(none)

Merge kaamos.(none):/data/src/opt/bug31781/my50

into  kaamos.(none):/data/src/opt/mysql-5.0-opt
parents fc1ae077 bd53f960
......@@ -35,7 +35,7 @@
File my_create(const char *FileName, int CreateFlags, int access_flags,
myf MyFlags)
{
int fd;
int fd, rc;
DBUG_ENTER("my_create");
DBUG_PRINT("my",("Name: '%s' CreateFlags: %d AccessFlags: %d MyFlags: %d",
FileName, CreateFlags, access_flags, MyFlags));
......@@ -60,6 +60,20 @@ File my_create(const char *FileName, int CreateFlags, int access_flags,
fd = open(FileName, access_flags);
#endif
DBUG_RETURN(my_register_filename(fd, FileName, FILE_BY_CREATE,
EE_CANTCREATEFILE, MyFlags));
rc= my_register_filename(fd, FileName, FILE_BY_CREATE,
EE_CANTCREATEFILE, MyFlags);
/*
my_register_filename() may fail on some platforms even if the call to
*open() above succeeds. In this case, don't leave the stale file because
callers assume the file to not exist if my_create() fails, so they don't
do any cleanups.
*/
if (unlikely(fd >= 0 && rc < 0))
{
int tmp= my_errno;
my_delete(FileName, MyFlags);
my_errno= tmp;
}
DBUG_RETURN(rc);
} /* my_create */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment