Fixed bug in loading libcanberra when falling back on alternative library names

This commit is contained in:
lyc 2019-11-30 14:36:22 +08:00
parent da7a78691f
commit 1c38654321

View File

@ -113,8 +113,8 @@ load_libcanberra(void) {
if (done) return; if (done) return;
done = true; done = true;
libcanberra_handle = dlopen(libname, RTLD_LAZY); libcanberra_handle = dlopen(libname, RTLD_LAZY);
if (libcanberra_handle == NULL) libsn_handle = dlopen(libname2, RTLD_LAZY); if (libcanberra_handle == NULL) libcanberra_handle = dlopen(libname2, RTLD_LAZY);
if (libcanberra_handle == NULL) libsn_handle = dlopen(libname3, RTLD_LAZY); if (libcanberra_handle == NULL) libcanberra_handle = dlopen(libname3, RTLD_LAZY);
if (libcanberra_handle == NULL) { if (libcanberra_handle == NULL) {
fprintf(stderr, "Failed to load %s, cannot play beep sound, with error: %s\n", libname, dlerror()); fprintf(stderr, "Failed to load %s, cannot play beep sound, with error: %s\n", libname, dlerror());
return; return;