Skip to content

Commit

Permalink
lib_common: print dlopen errs as warn
Browse files Browse the repository at this point in the history
Since the libraries should be bundled, treat the dlopen errors rather
as errors and issue warning. This also occurs eg. on bare debootstraped
Ubuntu system, where basic libraries like libasound2, libdrm and libgl1
are missing but are among those excluded from AppImages.
  • Loading branch information
MartinPulec committed Nov 6, 2023
1 parent 4e5de72 commit 0b4c0e8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/lib_common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@
#include "lib_common.h"
#include "utils/color_out.h"

#define MOD_NAME "[lib] "

using namespace std;

struct library_class_info_t {
Expand Down Expand Up @@ -192,8 +194,8 @@ void open_all(const char *pattern, list<void *> &libs) {
void *handle = dlopen(glob_buf.gl_pathv[i], RTLD_NOW|RTLD_GLOBAL);
if (!handle) {
char *error = dlerror();
verbose_msg("Library %s opening warning: %s \n", glob_buf.gl_pathv[i],
error);
MSG(WARNING, "Library %s opening warning: %s \n",
glob_buf.gl_pathv[i], error);
char *filename = basename(glob_buf.gl_pathv[i]);
if (filename && error) {
lib_errors.emplace(filename, error);
Expand Down

0 comments on commit 0b4c0e8

Please sign in to comment.