diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2017-09-01 11:33:45 +0300 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2017-09-01 11:33:45 +0300 |
commit | 4e1fa7f63da580c1e0e4256bc4af3c02cdc51939 (patch) | |
tree | 6ac1589c98dbf15a465365f4f16a09da51ea8c48 /client | |
parent | ff81faf670e083e1da4f3e7bce33fe9104410b2c (diff) | |
parent | 2f3968d98f8d90a9a9747e5b89c8f07efc6732e8 (diff) | |
download | mariadb-git-4e1fa7f63da580c1e0e4256bc4af3c02cdc51939.tar.gz |
Merge bb-10.2-ext into 10.3
Diffstat (limited to 'client')
-rw-r--r-- | client/mysqltest.cc | 32 |
1 files changed, 26 insertions, 6 deletions
diff --git a/client/mysqltest.cc b/client/mysqltest.cc index aafe608920e..1778cc134c9 100644 --- a/client/mysqltest.cc +++ b/client/mysqltest.cc @@ -574,15 +574,17 @@ struct st_replace *glob_replace= 0; void replace_strings_append(struct st_replace *rep, DYNAMIC_STRING* ds, const char *from, int len); -static void cleanup_and_exit(int exit_code) __attribute__((noreturn)); +ATTRIBUTE_NORETURN +static void cleanup_and_exit(int exit_code); -void really_die(const char *msg) __attribute__((noreturn)); +ATTRIBUTE_NORETURN +void really_die(const char *msg); void report_or_die(const char *fmt, ...) ATTRIBUTE_FORMAT(printf, 1, 2); -void die(const char *fmt, ...) ATTRIBUTE_FORMAT(printf, 1, 2) - __attribute__((noreturn)); +ATTRIBUTE_NORETURN ATTRIBUTE_FORMAT(printf, 1, 2) +void die(const char *fmt, ...); static void make_error_message(char *buf, size_t len, const char *fmt, va_list args); -void abort_not_supported_test(const char *fmt, ...) ATTRIBUTE_FORMAT(printf, 1, 2) - __attribute__((noreturn)); +ATTRIBUTE_NORETURN ATTRIBUTE_FORMAT(printf, 1, 2) +void abort_not_supported_test(const char *fmt, ...); void verbose_msg(const char *fmt, ...) ATTRIBUTE_FORMAT(printf, 1, 2); void log_msg(const char *fmt, ...) ATTRIBUTE_FORMAT(printf, 1, 2); @@ -4022,7 +4024,25 @@ static int rmtree(const char *dir) strxnmov(path, sizeof(path), dir, sep, file->name, NULL); if (!MY_S_ISDIR(file->mystat->st_mode)) + { err= my_delete(path, 0); +#ifdef _WIN32 + /* + On Windows, check and possible reset readonly attribute. + my_delete(), or DeleteFile does not remove theses files. + */ + if (err) + { + DWORD attr= GetFileAttributes(path); + if (attr != INVALID_FILE_ATTRIBUTES && + (attr & FILE_ATTRIBUTE_READONLY)) + { + SetFileAttributes(path, attr &~ FILE_ATTRIBUTE_READONLY); + err= my_delete(path, 0); + } + } +#endif + } else err= rmtree(path); |