summaryrefslogtreecommitdiff
path: root/mysys
diff options
context:
space:
mode:
authorBjorn Munch <Bjorn.Munch@sun.com>2009-09-02 23:29:11 +0200
committerBjorn Munch <Bjorn.Munch@sun.com>2009-09-02 23:29:11 +0200
commit31f9d5fd1675bca1c4b6f03b5319ac4e788de574 (patch)
tree39b408a53377f839d83f6256b8ec41cfd0d89591 /mysys
parenta829604260c4a485e74f2d30bbbf5f9619837b70 (diff)
parent41427950ed8bf62628d99936686d1f2db0528336 (diff)
downloadmariadb-git-31f9d5fd1675bca1c4b6f03b5319ac4e788de574.tar.gz
second merge from main, with adaptions
Diffstat (limited to 'mysys')
-rw-r--r--mysys/array.c2
-rw-r--r--mysys/mf_iocache.c14
-rw-r--r--mysys/mf_pack.c3
-rw-r--r--mysys/my_copy.c5
-rw-r--r--mysys/my_getopt.c2
-rw-r--r--mysys/my_redel.c5
-rw-r--r--mysys/typelib.c4
7 files changed, 22 insertions, 13 deletions
diff --git a/mysys/array.c b/mysys/array.c
index b65bd28616d..a1c49c2589d 100644
--- a/mysys/array.c
+++ b/mysys/array.c
@@ -67,7 +67,7 @@ my_bool init_dynamic_array2(DYNAMIC_ARRAY *array, uint element_size,
Since the dynamic array is usable even if allocation fails here malloc
should not throw an error
*/
- if (!(array->buffer= (char*) my_malloc_ci(element_size*init_alloc, MYF(0))))
+ if (!(array->buffer= (uchar*) my_malloc_ci(element_size*init_alloc, MYF(0))))
array->max_element=0;
DBUG_RETURN(FALSE);
}
diff --git a/mysys/mf_iocache.c b/mysys/mf_iocache.c
index 0f49dd22bb9..1a47982b221 100644
--- a/mysys/mf_iocache.c
+++ b/mysys/mf_iocache.c
@@ -227,15 +227,21 @@ int init_io_cache(IO_CACHE *info, File file, size_t cachesize,
for (;;)
{
size_t buffer_block;
+ /*
+ Unset MY_WAIT_IF_FULL bit if it is set, to prevent conflict with
+ MY_ZEROFILL.
+ */
+ myf flags= (myf) (cache_myflags & ~(MY_WME | MY_WAIT_IF_FULL));
+
if (cachesize < min_cache)
cachesize = min_cache;
buffer_block= cachesize;
if (type == SEQ_READ_APPEND)
buffer_block *= 2;
- if ((info->buffer=
- (uchar*) my_malloc(buffer_block,
- MYF((cache_myflags & ~ MY_WME) |
- (cachesize == min_cache ? MY_WME : 0)))) != 0)
+ if (cachesize == min_cache)
+ flags|= (myf) MY_WME;
+
+ if ((info->buffer= (uchar*) my_malloc(buffer_block, flags)) != 0)
{
info->write_buffer=info->buffer;
if (type == SEQ_READ_APPEND)
diff --git a/mysys/mf_pack.c b/mysys/mf_pack.c
index d4828946d82..9775a842b18 100644
--- a/mysys/mf_pack.c
+++ b/mysys/mf_pack.c
@@ -33,12 +33,11 @@ static char * NEAR_F expand_tilde(char * *path);
void pack_dirname(char * to, const char *from)
{
int cwd_err;
- size_t d_length,length,buff_length;
+ size_t d_length,length,UNINIT_VAR(buff_length);
char * start;
char buff[FN_REFLEN];
DBUG_ENTER("pack_dirname");
- LINT_INIT(buff_length);
(void) intern_filename(to,from); /* Change to intern name */
#ifdef FN_DEVCHAR
diff --git a/mysys/my_copy.c b/mysys/my_copy.c
index 5679d13d39d..64f1623aa59 100644
--- a/mysys/my_copy.c
+++ b/mysys/my_copy.c
@@ -56,6 +56,7 @@ int my_copy(const char *from, const char *to, myf MyFlags)
File from_file,to_file;
uchar buff[IO_SIZE];
MY_STAT stat_buff,new_stat_buff;
+ int res;
DBUG_ENTER("my_copy");
DBUG_PRINT("my",("from %s to %s MyFlags %d", from, to, MyFlags));
@@ -94,9 +95,9 @@ int my_copy(const char *from, const char *to, myf MyFlags)
if (MyFlags & MY_HOLD_ORIGINAL_MODES && !new_file_stat)
DBUG_RETURN(0); /* File copyed but not stat */
- VOID(chmod(to, stat_buff.st_mode & 07777)); /* Copy modes */
+ res= chmod(to, stat_buff.st_mode & 07777); /* Copy modes */
#if !defined(__WIN__) && !defined(__NETWARE__)
- VOID(chown(to, stat_buff.st_uid,stat_buff.st_gid)); /* Copy ownership */
+ res= chown(to, stat_buff.st_uid,stat_buff.st_gid); /* Copy ownership */
#endif
#if !defined(VMS) && !defined(__ZTC__)
if (MyFlags & MY_COPYTIME)
diff --git a/mysys/my_getopt.c b/mysys/my_getopt.c
index fd3c2501226..b6eb6dac54f 100644
--- a/mysys/my_getopt.c
+++ b/mysys/my_getopt.c
@@ -116,7 +116,7 @@ int handle_options(int *argc, char ***argv,
uint opt_found, argvpos= 0, length;
my_bool end_of_options= 0, must_be_var, set_maximum_value,
option_is_loose;
- char **pos, **pos_end, *optend, *prev_found,
+ char **pos, **pos_end, *optend, *UNINIT_VAR(prev_found),
*opt_str, key_name[FN_REFLEN];
const struct my_option *optp;
uchar* *value;
diff --git a/mysys/my_redel.c b/mysys/my_redel.c
index b12cf098283..6521253f949 100644
--- a/mysys/my_redel.c
+++ b/mysys/my_redel.c
@@ -76,6 +76,9 @@ end:
int my_copystat(const char *from, const char *to, int MyFlags)
{
struct stat statbuf;
+#if !defined(__WIN__) && !defined(__NETWARE__)
+ int res;
+#endif
if (stat((char*) from, &statbuf))
{
@@ -94,7 +97,7 @@ int my_copystat(const char *from, const char *to, int MyFlags)
if (MyFlags & MY_LINK_WARNING)
my_error(EE_LINK_WARNING,MYF(ME_BELL+ME_WAITTANG),from,statbuf.st_nlink);
}
- VOID(chown(to, statbuf.st_uid, statbuf.st_gid)); /* Copy ownership */
+ res= chown(to, statbuf.st_uid, statbuf.st_gid); /* Copy ownership */
#endif /* !__WIN__ && !__NETWARE__ */
#ifndef VMS
diff --git a/mysys/typelib.c b/mysys/typelib.c
index e745a9fb917..92ffe9316ff 100644
--- a/mysys/typelib.c
+++ b/mysys/typelib.c
@@ -70,7 +70,8 @@ int find_type_or_exit(const char *x, TYPELIB *typelib, const char *option)
int find_type(char *x, const TYPELIB *typelib, uint full_name)
{
- int find,pos,findpos;
+ int find,pos;
+ int UNINIT_VAR(findpos); /* guarded by find */
reg1 char * i;
reg2 const char *j;
DBUG_ENTER("find_type");
@@ -81,7 +82,6 @@ int find_type(char *x, const TYPELIB *typelib, uint full_name)
DBUG_PRINT("exit",("no count"));
DBUG_RETURN(0);
}
- LINT_INIT(findpos);
find=0;
for (pos=0 ; (j=typelib->type_names[pos]) ; pos++)
{