Added error output wsrep_print_version

This helps to determinate why galera library doesn't load
This commit is contained in:
Monty 2020-01-29 17:31:08 +02:00
parent bc89105496
commit cd2c0e013c

View File

@ -1,5 +1,4 @@
/* Copyright (c) 2009, 2019, MariaDB
/*
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
@ -86,12 +85,24 @@ int main(int argc, char **argv)
int rc = EINVAL;
void *dlh;
wsrep_loader_fun dlfun;
const char *provider= getenv("WSREP_PROVIDER");
if (!(dlh = dlopen(getenv("WSREP_PROVIDER"), RTLD_NOW | RTLD_LOCAL))) {
goto err;
if (!provider)
{
fprintf(stderr, "WSREP_PROVIDER is not set\n");
goto err;
}
if (!(dlh = dlopen(provider, RTLD_NOW | RTLD_LOCAL)))
{
fprintf(stderr, "Can't open WSREP_PROVIDER (%s) library, error: %s\n",
provider, dlerror());
goto err;
}
if (!(dlfun = wsrep_dlf(dlh, "wsrep_loader"))) {
if (!(dlfun = wsrep_dlf(dlh, "wsrep_loader")))
{
fprintf(stderr, "Can't find 'wsrep_loader' symbol in %s\n",
provider);
goto err;
}