summaryrefslogtreecommitdiff
path: root/mysys
diff options
context:
space:
mode:
Diffstat (limited to 'mysys')
-rw-r--r--mysys/charset.c6
-rw-r--r--mysys/default.c12
-rw-r--r--mysys/mf_tempfile.c9
-rw-r--r--mysys/my_init.c2
-rw-r--r--mysys/my_pread.c2
5 files changed, 19 insertions, 12 deletions
diff --git a/mysys/charset.c b/mysys/charset.c
index 54b4dd1a13e..16536b581bf 100644
--- a/mysys/charset.c
+++ b/mysys/charset.c
@@ -67,7 +67,7 @@ static char *name_from_csnum(CS_ID **cs, uint number)
for (c = cs; *c; ++c)
if ((*c)->number == number)
return (*c)->name;
- return "?"; /* this mimics find_type() */
+ return (char*) "?"; /* this mimics find_type() */
}
static my_bool get_word(struct simpleconfig_buf_st *fb, char *buf)
@@ -487,7 +487,7 @@ char * list_charsets(myf want_flags)
{
CS_ID **c;
char buf[FN_REFLEN];
- MY_STAT stat;
+ MY_STAT status;
if((c=available_charsets))
for (; *c; ++c)
@@ -495,7 +495,7 @@ char * list_charsets(myf want_flags)
if (charset_in_string((*c)->name, &s))
continue;
get_charset_conf_name((*c)->number, buf);
- if (!my_stat(buf, &stat, MYF(0)))
+ if (!my_stat(buf, &status, MYF(0)))
continue; /* conf file doesn't exist */
dynstr_append(&s, (*c)->name);
dynstr_append(&s, " ");
diff --git a/mysys/default.c b/mysys/default.c
index dda96d5092a..e7e2e7cc8ff 100644
--- a/mysys/default.c
+++ b/mysys/default.c
@@ -148,7 +148,7 @@ void load_defaults(const char *conf_file, const char **groups,
#endif
for (dirs=default_directories ; *dirs; dirs++)
{
- int error;
+ int error=0;
if (**dirs)
error=search_default_file(&args, &alloc, *dirs, conf_file,
default_ext, &group);
@@ -359,7 +359,12 @@ void print_defaults(const char *conf_file, const char **groups)
#endif
for (dirs=default_directories ; *dirs; dirs++)
{
- strmov(name,*dirs);
+ if (**dirs)
+ strmov(name,*dirs);
+ else if (defaults_extra_file)
+ strmov(name,defaults_extra_file);
+ else
+ continue;
convert_dirname(name);
if (name[0] == FN_HOMELIB) /* Add . to filenames in home */
strcat(name,".");
@@ -377,6 +382,7 @@ void print_defaults(const char *conf_file, const char **groups)
puts("\nThe following options may be given as the first argument:\n\
--print-defaults Print the program argument list and exit\n\
--no-defaults Don't read default options from any options file\n\
---defaults-file=# Only read default options from the given file #");
+--defaults-file=# Only read default options from the given file #\n\
+--defaults-extra-file=# Read this file after the global files are read");
}
diff --git a/mysys/mf_tempfile.c b/mysys/mf_tempfile.c
index 8370c6e7ec8..44826ad57c2 100644
--- a/mysys/mf_tempfile.c
+++ b/mysys/mf_tempfile.c
@@ -36,7 +36,8 @@ extern char **environ;
*/
File create_temp_file(char *to, const char *dir, const char *prefix,
- int mode, myf MyFlags)
+ int mode __attribute__((unused)),
+ myf MyFlags __attribute__((unused)))
{
File file= -1;
DBUG_ENTER("open_temp_file");
@@ -85,12 +86,12 @@ File create_temp_file(char *to, const char *dir, const char *prefix,
}
#elif defined(HAVE_MKSTEMP)
{
- char prefix[30];
+ char prefix_buff[30];
uint pfx_len;
- pfx_len=(strmov(strnmov(prefix,
+ pfx_len=(strmov(strnmov(prefix_buff,
prefix ? prefix : "tmp.",
- sizeof(prefix)-7),"XXXXXX") - prefix);
+ sizeof(prefix_buff)-7),"XXXXXX") - prefix_buff);
if (!dir && ! (dir =getenv("TMPDIR")))
dir=P_tmpdir;
if (strlen(dir)+ pfx_len > FN_REFLEN-2)
diff --git a/mysys/my_init.c b/mysys/my_init.c
index 4e7d1b6b2db..3b5eb83f9fe 100644
--- a/mysys/my_init.c
+++ b/mysys/my_init.c
@@ -48,7 +48,7 @@ static my_bool win32_init_tcp_ip();
static my_bool my_init_done=0;
-ulong atoi_octal(const char *str)
+static ulong atoi_octal(const char *str)
{
long int tmp;
while (*str && isspace(*str))
diff --git a/mysys/my_pread.c b/mysys/my_pread.c
index 74bb7783af5..4e0de71bcf5 100644
--- a/mysys/my_pread.c
+++ b/mysys/my_pread.c
@@ -80,7 +80,6 @@ uint my_pread(File Filedes, byte *Buffer, uint Count, my_off_t offset,
uint my_pwrite(int Filedes, const byte *Buffer, uint Count, my_off_t offset,
myf MyFlags)
{
- int error;
uint writenbytes,errors;
ulong written;
DBUG_ENTER("my_pwrite");
@@ -91,6 +90,7 @@ uint my_pwrite(int Filedes, const byte *Buffer, uint Count, my_off_t offset,
for (;;)
{
#ifndef HAVE_PREAD
+ int error;
writenbytes= (uint) -1;
pthread_mutex_lock(&my_file_info[Filedes].mutex);
error=(lseek(Filedes, offset, MY_SEEK_SET) != -1L &&