summaryrefslogtreecommitdiff
path: root/mysys
diff options
context:
space:
mode:
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.c3
-rw-r--r--mysys/my_getopt.c2
-rw-r--r--mysys/my_redel.c3
-rw-r--r--mysys/safemalloc.c3
-rw-r--r--mysys/typelib.c4
8 files changed, 23 insertions, 11 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 cb2fbf00f3e..62f60e9ce95 100644
--- a/mysys/my_copy.c
+++ b/mysys/my_copy.c
@@ -57,6 +57,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));
@@ -95,7 +96,7 @@ 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__)
if (chown(to, stat_buff.st_uid,stat_buff.st_gid))
{
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 598a728393d..6b0ceb85950 100644
--- a/mysys/my_redel.c
+++ b/mysys/my_redel.c
@@ -77,6 +77,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))
{
diff --git a/mysys/safemalloc.c b/mysys/safemalloc.c
index c666b517608..d6cd3896b08 100644
--- a/mysys/safemalloc.c
+++ b/mysys/safemalloc.c
@@ -272,6 +272,9 @@ void _myfree(void *ptr, const char *filename, uint lineno, myf myflags)
irem= (struct st_irem *) ((char*) ptr- ALIGN_SIZE(sizeof(struct st_irem))-
sf_malloc_prehunc);
+ if (sf_malloc_quick)
+ (void) _checkchunk(irem, filename, lineno);
+
/*
Check to make sure that we have a real remember structure.
Note: this test could fail for four reasons:
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++)
{