Print dlerror() in lib loaders

pull/131/head
jackun 4 years ago
parent 780ea7c89b
commit f3f04f3f78
No known key found for this signature in database
GPG Key ID: 119DB3F1D05A9ED3

@ -36,6 +36,10 @@ void* get_glx_proc_address(const char* name) {
if (!func)
func = get_proc_address( name );
if (!func) {
std::cerr << "MANGOHUD: Failed to get function '" << name << "'" << std::endl;
}
return func;
}

@ -1,5 +1,6 @@
#include "loaders/loader_dbus.h"
#include <iostream>
// Put these sanity checks here so that they fire at most once
// (to avoid cluttering the build output).
@ -24,8 +25,10 @@ bool libdbus_loader::Load(const std::string& library_name) {
#if defined(LIBRARY_LOADER_DBUS_H_DLOPEN)
library_ = dlopen(library_name.c_str(), RTLD_LAZY);
if (!library_)
if (!library_) {
std::cerr << "MANGOHUD: " << library_name << " dlopen failed: " << dlerror() << std::endl;
return false;
}
bus_add_match =

@ -17,7 +17,7 @@ bool glx_loader::Load() {
// Force load libGL
void *handle = real_dlopen("libGL.so.1", RTLD_LAZY);
if (!handle) {
std::cerr << "MANGOHUD: couldn't find libGL.so.1" << std::endl;
std::cerr << "MANGOHUD: couldn't find libGL.so.1: " << dlerror() << std::endl;
return false;
}

@ -1,7 +1,5 @@
// This is generated file. Do not modify directly.
// Path to the code generator: /home/crz/git/MangoHud/generate_library_loader.py .
#include "loader_nvctrl.h"
#include <iostream>
// Put these sanity checks here so that they fire at most once
// (to avoid cluttering the build output).
@ -26,8 +24,10 @@ bool libnvctrl_loader::Load(const std::string& library_name) {
#if defined(LIBRARY_LOADER_NVCTRL_H_DLOPEN)
library_ = dlopen(library_name.c_str(), RTLD_LAZY);
if (!library_)
if (!library_) {
std::cerr << "MANGOHUD: " << library_name << " dlopen failed: " << dlerror() << std::endl;
return false;
}
XNVCTRLIsNvScreen =
reinterpret_cast<decltype(this->XNVCTRLIsNvScreen)>(

@ -1,5 +1,5 @@
#include "loader_x11.h"
#include "real_dlsym.h"
#include <iostream>
libx11_loader::libx11_loader() : loaded_(false) {
}
@ -13,9 +13,11 @@ bool libx11_loader::Load(const std::string& library_name) {
return false;
}
library_ = real_dlopen(library_name.c_str(), RTLD_LAZY);
if (!library_)
library_ = dlopen(library_name.c_str(), RTLD_LAZY);
if (!library_) {
std::cerr << "MANGOHUD: " << library_name << " dlopen failed: " << dlerror() << std::endl;
return false;
}
XOpenDisplay =

Loading…
Cancel
Save