summaryrefslogtreecommitdiff
path: root/mysys/mf_tempdir.c
diff options
context:
space:
mode:
authoriggy@recycle.(none) <>2007-03-20 10:54:56 -0400
committeriggy@recycle.(none) <>2007-03-20 10:54:56 -0400
commita56b04476a2c098edb04773532d2067f465c3edf (patch)
tree89d98cdcae5530c2708979517d9dc11f32fc471f /mysys/mf_tempdir.c
parent8ecbf6c03de5e337187263b9309ff6b03cd5082a (diff)
parent988ce580526ab3886f25cae381858855348b2d70 (diff)
downloadmariadb-git-a56b04476a2c098edb04773532d2067f465c3edf.tar.gz
Merge recycle.(none):/src/bug23736/my50-bug23736
into recycle.(none):/src/bug23736/my51-bug23736
Diffstat (limited to 'mysys/mf_tempdir.c')
-rw-r--r--mysys/mf_tempdir.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/mysys/mf_tempdir.c b/mysys/mf_tempdir.c
index 8d3fc40e96d..ac61558725c 100644
--- a/mysys/mf_tempdir.c
+++ b/mysys/mf_tempdir.c
@@ -26,12 +26,11 @@ my_bool init_tmpdir(MY_TMPDIR *tmpdir, const char *pathlist)
{
char *end, *copy;
char buff[FN_REFLEN];
- DYNAMIC_ARRAY t_arr;
DBUG_ENTER("init_tmpdir");
DBUG_PRINT("enter", ("pathlist: %s", pathlist ? pathlist : "NULL"));
pthread_mutex_init(&tmpdir->mutex, MY_MUTEX_INIT_FAST);
- if (my_init_dynamic_array(&t_arr, sizeof(char*), 1, 5))
+ if (my_init_dynamic_array(&tmpdir->full_list, sizeof(char*), 1, 5))
goto err;
if (!pathlist || !pathlist[0])
{
@@ -53,14 +52,14 @@ my_bool init_tmpdir(MY_TMPDIR *tmpdir, const char *pathlist)
strmake(buff, pathlist, (uint) (end-pathlist));
length= cleanup_dirname(buff, buff);
if (!(copy= my_strndup(buff, length, MYF(MY_WME))) ||
- insert_dynamic(&t_arr, (gptr) &copy))
+ insert_dynamic(&tmpdir->full_list, (gptr) &copy))
DBUG_RETURN(TRUE);
pathlist=end+1;
}
while (*end);
- freeze_size(&t_arr);
- tmpdir->list=(char **)t_arr.buffer;
- tmpdir->max=t_arr.elements-1;
+ freeze_size(&tmpdir->full_list);
+ tmpdir->list=(char **)tmpdir->full_list.buffer;
+ tmpdir->max=tmpdir->full_list.elements-1;
tmpdir->cur=0;
DBUG_RETURN(FALSE);
@@ -88,7 +87,7 @@ void free_tmpdir(MY_TMPDIR *tmpdir)
uint i;
for (i=0; i<=tmpdir->max; i++)
my_free(tmpdir->list[i], MYF(0));
- my_free((gptr)tmpdir->list, MYF(0));
+ delete_dynamic(&tmpdir->full_list);
pthread_mutex_destroy(&tmpdir->mutex);
}