Commit 7e85c092 authored by Tom Anderson's avatar Tom Anderson Committed by Commit Bot

[GTK] Fix libappindicator library name for dlopen()

STRINGIZE(GTK_MAJOR_VERSION) evaluates to "(3)", so we previously tried to open
"libappindicator(3).so.1" when we wanted to open "libappindicator3.so.1".

BUG=893932
R=pkasting

Change-Id: I91544994898ae136c404a88a561e8f789c801c62
Reviewed-on: https://chromium-review.googlesource.com/c/1308670
Commit-Queue: Thomas Anderson <thomasanderson@chromium.org>
Reviewed-by: default avatarPeter Kasting <pkasting@chromium.org>
Cr-Commit-Position: refs/heads/master@{#604065}
parent f5cc4c94
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
#include "base/files/file_util.h" #include "base/files/file_util.h"
#include "base/md5.h" #include "base/md5.h"
#include "base/memory/ref_counted_memory.h" #include "base/memory/ref_counted_memory.h"
#include "base/strings/stringize_macros.h" #include "base/strings/string_number_conversions.h"
#include "base/strings/stringprintf.h" #include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h" #include "base/strings/utf_string_conversions.h"
#include "base/task/post_task.h" #include "base/task/post_task.h"
...@@ -89,16 +89,13 @@ void EnsureMethodsLoaded() { ...@@ -89,16 +89,13 @@ void EnsureMethodsLoaded() {
g_attempted_load = true; g_attempted_load = true;
void* indicator_lib = nullptr; std::string lib_name =
"libappindicator" + base::NumberToString(GTK_MAJOR_VERSION) + ".so";
void* indicator_lib = dlopen(lib_name.c_str(), RTLD_LAZY);
if (!indicator_lib) { if (!indicator_lib) {
indicator_lib = lib_name += ".1";
dlopen("libappindicator" STRINGIZE(GTK_MAJOR_VERSION) ".so", RTLD_LAZY); indicator_lib = dlopen(lib_name.c_str(), RTLD_LAZY);
}
if (!indicator_lib) {
indicator_lib = dlopen(
"libappindicator" STRINGIZE(GTK_MAJOR_VERSION) ".so.1", RTLD_LAZY);
} }
if (!indicator_lib) if (!indicator_lib)
......
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