diff options
author | unknown <knielsen@knielsen-hq.org> | 2009-10-15 23:38:29 +0200 |
---|---|---|
committer | unknown <knielsen@knielsen-hq.org> | 2009-10-15 23:38:29 +0200 |
commit | 6aad537a6aa1381b73e87e53a5a17eda4ef1d452 (patch) | |
tree | 9366ff2dea102dc28d90ffad1cf8dff3039650e0 /mysys | |
parent | 8ea19fa73e86a3c27917a92affd6a9e43763c7ce (diff) | |
parent | c7d32876f345785580a7cf286542ccf390b4e1fa (diff) | |
download | mariadb-git-6aad537a6aa1381b73e87e53a5a17eda4ef1d452.tar.gz |
Merge MySQL 5.1.39 into MariaDB 5.1.
Diffstat (limited to 'mysys')
-rw-r--r-- | mysys/array.c | 2 | ||||
-rw-r--r-- | mysys/mf_iocache.c | 14 | ||||
-rw-r--r-- | mysys/mf_pack.c | 3 | ||||
-rw-r--r-- | mysys/my_copy.c | 5 | ||||
-rw-r--r-- | mysys/my_getopt.c | 2 | ||||
-rw-r--r-- | mysys/my_redel.c | 5 | ||||
-rw-r--r-- | mysys/typelib.c | 4 |
7 files changed, 22 insertions, 13 deletions
diff --git a/mysys/array.c b/mysys/array.c index 743bf4ef302..a18223e9cae 100644 --- a/mysys/array.c +++ b/mysys/array.c @@ -61,7 +61,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 6d63f8b8bf5..59872961523 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 5a06b18d4b8..3d961c3bcee 100644 --- a/mysys/my_getopt.c +++ b/mysys/my_getopt.c @@ -115,7 +115,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 ff5dc1231e4..26bfdaee2c2 100644 --- a/mysys/typelib.c +++ b/mysys/typelib.c @@ -78,7 +78,8 @@ uint 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"); @@ -89,7 +90,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++) { |