diff options
author | unknown <msvensson@shellback.(none)> | 2007-10-05 18:18:50 +0200 |
---|---|---|
committer | unknown <msvensson@shellback.(none)> | 2007-10-05 18:18:50 +0200 |
commit | b07a4abc4fefb2e14cdcd3203b92865a643bf962 (patch) | |
tree | da1ec9525e3653c7249315af45cd2b5591d72285 /client | |
parent | 133bd811dbb73366b36a05b9b7d252c4be8374af (diff) | |
download | mariadb-git-b07a4abc4fefb2e14cdcd3203b92865a643bf962.tar.gz |
Bug#31398 problems with mysql-test-run, part2
Write .reject file to r/ if it's writable else use opt_logdir
client/mysqltest.c:
Write .reject file to r/ if it's writable else use opt_logdir
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 a2412d4b30e..eae3b05f61a 100644 --- a/client/mysqltest.c +++ b/client/mysqltest.c @@ -1580,10 +1580,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 */ |