diff options
author | unknown <ramil@ram-book.(none)> | 2005-05-06 16:51:58 +0500 |
---|---|---|
committer | unknown <ramil@ram-book.(none)> | 2005-05-06 16:51:58 +0500 |
commit | 4ef759c84ded2d3696c9254b66bb31ab593d5398 (patch) | |
tree | f72f9af77e33f4f1faeef327d840053f4a9fd9fd /mysys | |
parent | 56426fca8888bd867f6862561ae17fe6f5ca6669 (diff) | |
download | mariadb-git-4ef759c84ded2d3696c9254b66bb31ab593d5398.tar.gz |
A fix (bug #5056: defaults-extra-file throws no error when file is inaccessible).
mysys/default.c:
A fix (bug #5056: defaults-extra-file throws no error when file is inaccessible).
Return an error if we cannot read default file(s).
Diffstat (limited to 'mysys')
-rw-r--r-- | mysys/default.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/mysys/default.c b/mysys/default.c index e3a0b8a20ad..5afefa5463d 100644 --- a/mysys/default.c +++ b/mysys/default.c @@ -152,10 +152,15 @@ int my_search_option_files(const char *conf_file, int *argc, char ***argv, } else if (defaults_extra_file) { - if (search_default_file(func, func_ctx, NullS, - defaults_extra_file) < 0) + if (search_default_file_with_ext(func, func_ctx, "", "", + defaults_extra_file, 0) < 0) goto err; /* Fatal error */ - + if (error > 0) + { + fprintf(stderr, "Could not open required defaults file: %s\n", + defaults_extra_file); + goto err; + } } } } @@ -526,7 +531,7 @@ static int search_default_file_with_ext(Process_option_func opt_handler, } #endif if (!(fp= my_fopen(name, O_RDONLY, MYF(0)))) - return 0; /* Ignore wrong files */ + return 1; /* Ignore wrong files */ while (fgets(buff, sizeof(buff) - 1, fp)) { |