diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2021-03-11 20:09:34 +0200 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2021-03-11 20:09:34 +0200 |
commit | a4b7232b2cfd504057c26f9b40a2dacf064dca73 (patch) | |
tree | 9a33e1d13f7b7b716da89fe41f3ffdd3bf6221ba /extra/mariabackup/xtrabackup.cc | |
parent | a8650b64ede7330e83e84226cccd77ba8e05fa29 (diff) | |
parent | 1ea6ac3c953f847da033254d5df67f57987a1884 (diff) | |
download | mariadb-git-a4b7232b2cfd504057c26f9b40a2dacf064dca73.tar.gz |
Merge 10.4 into 10.5
Diffstat (limited to 'extra/mariabackup/xtrabackup.cc')
-rw-r--r-- | extra/mariabackup/xtrabackup.cc | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/extra/mariabackup/xtrabackup.cc b/extra/mariabackup/xtrabackup.cc index 5523392bbdb..b7839dc4944 100644 --- a/extra/mariabackup/xtrabackup.cc +++ b/extra/mariabackup/xtrabackup.cc @@ -61,6 +61,10 @@ Street, Fifth Floor, Boston, MA 02110-1335 USA #include <sys/resource.h> #endif +#ifdef __APPLE__ +# include "libproc.h" +#endif + #include <btr0sea.h> #include <dict0priv.h> @@ -6243,8 +6247,9 @@ void handle_options(int argc, char **argv, char ***argv_server, } } + mariabackup_args.push_back(nullptr); *argv_client= *argv_server= *argv_backup= &mariabackup_args[0]; - int argc_backup= static_cast<int>(mariabackup_args.size()); + int argc_backup= static_cast<int>(mariabackup_args.size() - 1); int argc_client= argc_backup; int argc_server= argc_backup; @@ -6707,6 +6712,12 @@ static int get_exepath(char *buf, size_t size, const char *argv0) ssize_t ret = readlink("/proc/self/exe", buf, size-1); if(ret > 0) return 0; +#elif defined(__APPLE__) + size_t ret = proc_pidpath(getpid(), buf, static_cast<uint32_t>(size)); + if (ret > 0) { + buf[ret] = 0; + return 0; + } #endif return my_realpath(buf, argv0, 0); |