diff options
author | unknown <msvensson@shellback.(none)> | 2007-10-05 18:19:37 +0200 |
---|---|---|
committer | unknown <msvensson@shellback.(none)> | 2007-10-05 18:19:37 +0200 |
commit | f21c216e3f55569e7a2855ea69ec330941874fd3 (patch) | |
tree | 365758b316d4c023cb9eb10bb569ac41321465e7 /client | |
parent | b16630e428531b62c9e6606e87e8ec6f7e2e8d69 (diff) | |
parent | b07a4abc4fefb2e14cdcd3203b92865a643bf962 (diff) | |
download | mariadb-git-f21c216e3f55569e7a2855ea69ec330941874fd3.tar.gz |
Merge shellback.(none):/home/msvensson/mysql/mysql-5.0-maint
into shellback.(none):/home/msvensson/mysql/mysql-5.1-maint
client/mysqltest.c:
Auto merged
Diffstat (limited to 'client')
-rw-r--r-- | client/mysqltest.c | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/client/mysqltest.c b/client/mysqltest.c index 26a0a9baaf6..4a80ad8d715 100644 --- a/client/mysqltest.c +++ b/client/mysqltest.c @@ -1563,10 +1563,21 @@ void check_result(DYNAMIC_STRING* ds) and then show the diff */ char reject_file[FN_REFLEN]; - str_to_file(fn_format(reject_file, result_file_name, opt_logdir, ".reject", - *opt_logdir ? MY_REPLACE_DIR | MY_REPLACE_EXT : - MY_REPLACE_EXT), - ds->str, ds->length); + dirname_part(reject_file, result_file_name); + + if (access(reject_file, W_OK) == 0) + { + /* Result file directory is writable, save reject file there */ + fn_format(reject_file, result_file_name, NULL, + ".reject", MY_REPLACE_EXT); + } + else + { + /* Put reject file in opt_logdir */ + fn_format(reject_file, result_file_name, opt_logdir, + ".reject", MY_REPLACE_DIR | MY_REPLACE_EXT); + } + str_to_file(reject_file, ds->str, ds->length); dynstr_set(ds, NULL); /* Don't create a .log file */ |