diff options
author | Marc Alff <marc.alff@sun.com> | 2009-09-17 03:20:11 -0600 |
---|---|---|
committer | Marc Alff <marc.alff@sun.com> | 2009-09-17 03:20:11 -0600 |
commit | 071634bb3578a3949e09197f7eb17c5619d01562 (patch) | |
tree | d0d731222454addb05b3890fb2bc555da5af7d63 /mysys | |
parent | ea0d4516ed796179ef97a791bb04a646ac98610b (diff) | |
parent | c65bfe456456db2aa60e2275b9ca428c76bbede4 (diff) | |
download | mariadb-git-071634bb3578a3949e09197f7eb17c5619d01562.tar.gz |
Merge mysql-next-mr --> mysql-trunk-signal
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 | 12 | ||||
-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, 29 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..418e2b6f8a2 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)); @@ -87,6 +88,13 @@ int my_copy(const char *from, const char *to, myf MyFlags) goto err; } + /* sync the destination file */ + if (MyFlags & MY_SYNC) + { + if (my_sync(to_file, MyFlags)) + goto err; + } + if (my_close(from_file,MyFlags) | my_close(to_file,MyFlags)) DBUG_RETURN(-1); /* Error on close */ @@ -94,9 +102,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++) { |