diff options
author | monty@donna.mysql.com <> | 2000-12-18 16:09:19 +0200 |
---|---|---|
committer | monty@donna.mysql.com <> | 2000-12-18 16:09:19 +0200 |
commit | 155823ad5118be2fe50d9ef705bc5d627b7333b0 (patch) | |
tree | c93d85948282e07d8ce6727243cecb6a03d0335f /mysys/my_create.c | |
parent | 5cce198b6959a910925bf90c5abfb2275bff1891 (diff) | |
download | mariadb-git-155823ad5118be2fe50d9ef705bc5d627b7333b0.tar.gz |
Lots of new benchmark runs
Remember filename for temporary files created with mkstemp
Fixed wrongly allocated BDB share structure
Cleanups for SunPRO
Diffstat (limited to 'mysys/my_create.c')
-rw-r--r-- | mysys/my_create.c | 37 |
1 files changed, 2 insertions, 35 deletions
diff --git a/mysys/my_create.c b/mysys/my_create.c index 8273170fc0a..ee5d9aa41f3 100644 --- a/mysys/my_create.c +++ b/mysys/my_create.c @@ -59,39 +59,6 @@ File my_create(const char *FileName, int CreateFlags, int access_flags, fd = open(FileName, access_flags); #endif - if (fd >= 0) - { - if ((int) fd >= MY_NFILE) - { -#if defined(THREAD) && !defined(HAVE_PREAD) - (void) my_close(fd,MyFlags); - my_errno=EMFILE; - if (MyFlags & (MY_FFNF | MY_FAE | MY_WME)) - my_error(EE_OUT_OF_FILERESOURCES, MYF(ME_BELL+ME_WAITTANG), - FileName, my_errno); - DBUG_RETURN(-1); -#else - thread_safe_increment(my_file_opened,&THR_LOCK_open); - DBUG_PRINT("exit",("fd: %d",fd)); - DBUG_RETURN(fd); /* safeguard */ -#endif - } - if ((my_file_info[fd].name = (char*) my_strdup(FileName,MyFlags))) - { - my_file_opened++; - my_file_info[fd].type = FILE_BY_CREATE; -#if defined(THREAD) && !defined(HAVE_PREAD) - pthread_mutex_init(&my_file_info[fd].mutex,NULL); -#endif - DBUG_PRINT("exit",("fd: %d",fd)); - DBUG_RETURN(fd); - } - VOID(my_close(fd,MyFlags)); - my_errno=ENOMEM; - } - else - my_errno=errno; - if (MyFlags & (MY_FFNF | MY_FAE | MY_WME)) - my_error(EE_CANTCREATEFILE, MYF(ME_BELL+ME_WAITTANG), FileName,my_errno); - DBUG_RETURN(-1); + DBUG_RETURN(my_register_filename(fd, FileName, FILE_BY_CREATE, + EE_CANTCREATEFILE, MyFlags)); } /* my_create */ |