bug 1245745 include libpulse version in update URL r=glandium

This commit is contained in:
Karl Tomlinson 2016-02-09 14:35:03 +13:00
parent 503543260f
commit 281254ba81

View File

@ -31,6 +31,7 @@
#ifdef MOZ_WIDGET_GTK #ifdef MOZ_WIDGET_GTK
#include <gtk/gtk.h> #include <gtk/gtk.h>
#include <dlfcn.h>
#include <unistd.h> #include <unistd.h>
#include <fstream> #include <fstream>
#include "mozilla/Tokenizer.h" #include "mozilla/Tokenizer.h"
@ -702,13 +703,33 @@ nsSystemInfo::Init()
gtk_micro_version); gtk_micro_version);
} }
nsAutoCString secondaryLibrary;
if (gtkver_len > 0) { if (gtkver_len > 0) {
rv = SetPropertyAsACString(NS_LITERAL_STRING("secondaryLibrary"), secondaryLibrary.Append(nsDependentCSubstring(gtkver, gtkver_len));
nsDependentCSubstring(gtkver, gtkver_len)); }
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv; void* libpulse = dlopen("libpulse.so.0", RTLD_LAZY);
const char* libpulseVersion = "not-available";
if (libpulse) {
auto pa_get_library_version = reinterpret_cast<const char* (*)()>
(dlsym(libpulse, "pa_get_library_version"));
if (pa_get_library_version) {
libpulseVersion = pa_get_library_version();
} }
} }
secondaryLibrary.AppendPrintf(",libpulse %s", libpulseVersion);
if (libpulse) {
dlclose(libpulse);
}
rv = SetPropertyAsACString(NS_LITERAL_STRING("secondaryLibrary"),
secondaryLibrary);
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
}
#endif #endif
#ifdef MOZ_WIDGET_ANDROID #ifdef MOZ_WIDGET_ANDROID