Merge ssh://bk-internal.mysql.com//home/bk/mysql-5.1-opt
into kaamos.(none):/data/src/opt/mysql-5.1-opt
This commit is contained in:
commit
fa9a16de83
@ -34,7 +34,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));
|
||||
@ -52,6 +52,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 */
|
||||
|
Loading…
x
Reference in New Issue
Block a user