Commit f58142f6 authored by Vladislav Vaintroub's avatar Vladislav Vaintroub

Mariabackup : don't change argv[0] to "innobackupex" in innobackupex mode.

addr2line utility optionally used to output stacktrace relies relies on
correct my_progname, which is initialized from argv[0] from main function.
Thus, changing argv[0] can confuse stacktrace output.
parent 9284e8b2
......@@ -6399,8 +6399,7 @@ handle_options(int argc, char **argv, char ***argv_client, char ***argv_server)
for (n = 0; (*argv_client)[n]; n++) {};
argc_client = n;
if (strcmp(base_name(my_progname), INNOBACKUPEX_BIN_NAME) == 0 &&
argc_client > 0) {
if (innobackupex_mode && argc_client > 0) {
/* emulate innobackupex script */
innobackupex_mode = true;
if (!ibx_handle_options(&argc_client, argv_client)) {
......@@ -6446,12 +6445,11 @@ int main(int argc, char **argv)
{
char **client_defaults, **server_defaults;
char cwd[FN_REFLEN];
static char INNOBACKUPEX_EXE[]= "innobackupex";
static char INNOBACKUPEX_EXE[]= "innobackupex";
if (argc > 1 && (strcmp(argv[1], "--innobackupex") == 0))
{
argv++;
argc--;
argv[0] = INNOBACKUPEX_EXE;
innobackupex_mode = true;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment