diff options
author | monty@mysql.com <> | 2003-12-11 06:24:08 +0200 |
---|---|---|
committer | monty@mysql.com <> | 2003-12-11 06:24:08 +0200 |
commit | 7e92336b1da07c6424f3bdffcc5d3edf268268fa (patch) | |
tree | 1122f20a76a6996599a4c136c6be17aecb8f8bf6 /mysys/mf_pack.c | |
parent | 34d0a16476e0db669bbe7cd9e56bb1d55ac1f18d (diff) | |
download | mariadb-git-7e92336b1da07c6424f3bdffcc5d3edf268268fa.tar.gz |
Fixed a possible memory leak on MacOSX when using the shared libmysql.so library (Bug #2061)
mysql_server_init() now returns error code if something went wrong (Bug #2062)
Don't use my_fopen() when reading symlink information as this may cause problems when a lot of files are opened.
Free thread keys with pthread_key_delete() instead of relying on automatic free. (Bug #2062)
Fixed bug in UNION statement with alias '*'. (Bug #1249)
Fixed a bug in DELETE ... ORDER BY ... LIMIT where the rows where not deleted in the proper order. (Bug #1024).
FOUND_ROWS() could return incorrect number of rows after a query with an impossible WHERE condition.
HOW DATABASES doesn't anymore show .sym files (on windows) that doesn't point to a valid directory. (Bug #1385)
Diffstat (limited to 'mysys/mf_pack.c')
-rw-r--r-- | mysys/mf_pack.c | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/mysys/mf_pack.c b/mysys/mf_pack.c index b3aa347006e..e2e811fe89a 100644 --- a/mysys/mf_pack.c +++ b/mysys/mf_pack.c @@ -210,13 +210,13 @@ uint cleanup_dirname(register my_string to, const char *from) } /* cleanup_dirname */ - /* - On system where you don't have symbolic links, the following - code will allow you to create a file: - directory-name.lnk that should contain the real path - to the directory. This will be used if the directory name - doesn't exists - */ +/* + On system where you don't have symbolic links, the following + code will allow you to create a file: + directory-name.sym that should contain the real path + to the directory. This will be used if the directory name + doesn't exists +*/ my_bool my_use_symdir=0; /* Set this if you want to use symdirs */ @@ -228,16 +228,17 @@ void symdirget(char *dir) char *pos=strend(dir); if (dir[0] && pos[-1] != FN_DEVCHAR && access(dir, F_OK)) { - FILE *fp; + File file; + uint length; char temp= *(--pos); /* May be "/" or "\" */ strmov(pos,".sym"); - fp = my_fopen(dir, O_RDONLY,MYF(0)); + file= my_open(dir, O_RDONLY, MYF(0)); *pos++=temp; *pos=0; /* Restore old filename */ - if (fp) + if (file >= 0) { - if (fgets(buff, sizeof(buff)-1, fp)) + if ((length= my_read(file, buff, sizeof(buff), MYF(0))) > 0) { - for (pos=strend(buff); + for (pos= buff + length ; pos > buff && (iscntrl(pos[-1]) || isspace(pos[-1])) ; pos --); @@ -247,7 +248,7 @@ void symdirget(char *dir) strmake(dir,buff, (uint) (pos-buff)); } - my_fclose(fp,MYF(0)); + my_close(file, MYF(0)); } } } |