diff --git a/api/graphics_lib.C b/api/graphics_lib.C index 5d77d80eae..d02b7cb857 100644 --- a/api/graphics_lib.C +++ b/api/graphics_lib.C @@ -70,9 +70,15 @@ int boinc_init_options_graphics_lib( boinc_main_state.set_worker_timer_hook = set_worker_timer; boinc_main_state.app_client_shmp = &app_client_shm; - ptr = argv0; + // figure out name of executable, and append .so + // + if ((ptr = strrchr(argv0, '/'))) { + ptr++; + } else { + ptr = argv0; + } strcpy(graphics_lib, ptr); - strncat(graphics_lib, DLLEXT, BOINC_STRLEN); + strncat(graphics_lib, ".so", BOINC_STRLEN); graphics_lib[BOINC_STRLEN-1] = 0; // boinc-resolve library name: it could be a XML symlink @@ -82,7 +88,6 @@ int boinc_init_options_graphics_lib( "Unable to boinc_resolve name of shared object file %s\n", graphics_lib ); - fflush(stderr); goto no_graphics; } @@ -97,7 +102,6 @@ int boinc_init_options_graphics_lib( fprintf(stderr, "dlopen() failed: %s\nNo graphics.\n", errormsg?errormsg:"" ); - fflush(stderr); goto no_graphics; }