Fix so-names for additional libraries
Commit 36e738e fixed the name passed to dlopen for libsqlite3.so. This patch fixes the names for other libraries as well.
Hi Kristoffer,
Holiday season... LGTM, but let me have a closer look. Lars or me will merge/comment soon. If this does not happen till the end of the week, feel free to kick us.
Thanks, rck
No problem, same here :)
On Wed, Aug 15, 2018 at 07:32:07AM -0700, Kristoffer Grönlund wrote: Subject: [PATCH] Fix so-names for additional libraries
Commit 36e738e fixed the name passed to dlopen for libsqlite3.so. This patch fixes the names for other libraries as well.
db_mysql.c | 8 ++++---- db_postgres.c | 8 ++++---- db_sqlite2.c | 11 ++++-------
- dl_handle = dlopen("libmysqlclient.so", RTLD_LAZY);
- dl_handle = dlopen("libmysqlclient.so.18", RTLD_LAZY);
- dl_handle = dlopen("libpq.so", RTLD_LAZY);
- dl_handle = dlopen("libpq.so.5", RTLD_LAZY);
Not that easy.
Probably needs to have a configure.ac replacement define there somehow, because distributions/distribution versions ship different versions of these libraries. You hardcode .18, but others may be at older versions still, or are at newer versions already (debian/ubuntu are .20 afaics). Similar with libpq.
That was not a problem with sqlite3, there (currently) is only the .0 out there, so I was Same with sqlite2 (if someone really still wants to use that):
- dl_handle = dlopen("libsqlite.so", RTLD_LAZY);
- dl_handle = dlopen("libsqlite.so.0", RTLD_LAZY);
But if "someone" was to fix the other instances, that should be fixed properly for sqlite2/3 as well.
Note: csync2 with postgres and mysql would likely need a bit polish on the table creation, index definition and probably SQL queries in general to work "as intended" in all situations.
Cheers, Lars
Yeah, this is clearly not a proper fix, but we've had this patch laying around forever so I thought I should at least submit it for review :)