diff options
author | monty@donna.mysql.com <> | 2000-09-12 03:02:33 +0300 |
---|---|---|
committer | monty@donna.mysql.com <> | 2000-09-12 03:02:33 +0300 |
commit | 2776500c220c92bb78df03513cc3dd33588f40e5 (patch) | |
tree | 051686baf31e5363765879f2437ada3abea6b71b /mysys/my_fopen.c | |
parent | 497007e2bd9cb127d54a4fdb02253301f404ce7f (diff) | |
download | mariadb-git-2776500c220c92bb78df03513cc3dd33588f40e5.tar.gz |
Update to new root alloc, OPTIMIZE TABLE and some other changes
Diffstat (limited to 'mysys/my_fopen.c')
-rw-r--r-- | mysys/my_fopen.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/mysys/my_fopen.c b/mysys/my_fopen.c index b2e99518792..30424874aa0 100644 --- a/mysys/my_fopen.c +++ b/mysys/my_fopen.c @@ -44,7 +44,10 @@ FILE *my_fopen(const char *FileName, int Flags, myf MyFlags) so we can ignore if this doesn't work. */ if ((uint) fileno(fd) >= MY_NFILE) + { + thread_safe_increment(my_stream_opened,&THR_LOCK_open); DBUG_RETURN(fd); /* safeguard */ + } pthread_mutex_lock(&THR_LOCK_open); if ((my_file_info[fileno(fd)].name = (char*) my_strdup(FileName,MyFlags))) @@ -87,11 +90,12 @@ int my_fclose(FILE *fd, myf MyFlags) my_error(EE_BADCLOSE, MYF(ME_BELL+ME_WAITTANG), my_filename(file),errno); } + else + my_stream_opened--; if ((uint) file < MY_NFILE && my_file_info[file].type != UNOPEN) { my_file_info[file].type = UNOPEN; my_free(my_file_info[file].name, MYF(0)); - my_stream_opened--; } pthread_mutex_unlock(&THR_LOCK_open); DBUG_RETURN(err); |