Skip to content

Commit 7de7e9e

Browse files
committed
CHANGE: show an error message when failing to load a library on POSIX
1 parent e52542b commit 7de7e9e

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/os/posix/host-lib.c

+8-8
Original file line numberDiff line numberDiff line change
@@ -738,7 +738,7 @@ RL_LIB *RL; // Link back to reb-lib from embedded extensions (like for now: host
738738
{
739739
#ifndef NO_DL_LIB
740740
void *dll = dlopen(path, RTLD_LAZY/*|RTLD_GLOBAL*/);
741-
// if(!dll) printf("dlerror: %s\n", dlerror());
741+
if (!dll) fprintf(stderr, "dlerror: %s\n", dlerror());
742742
*error = 0; // dlerror() returns a char* error message, so there's
743743
// no immediate way to return an "error code" in *error
744744
return dll;
@@ -1340,14 +1340,14 @@ static int Try_Browser(char *browser, REBCHR *url)
13401340
exit(1);
13411341
break;
13421342
default:
1343-
sleep(1); // needed else WEXITSTATUS sometimes reports value 127
1344-
if (0 > waitpid(pid, &status, WUNTRACED)) {
1345-
result = FALSE;
1346-
} else {
1347-
//printf("status: %i WIFEXITED: %i WEXITSTATUS: %i\n", status, WIFEXITED(status), WEXITSTATUS(status) );
1348-
result = WIFEXITED(status)
1343+
sleep(1); // needed else WEXITSTATUS sometimes reports value 127
1344+
if (0 > waitpid(pid, &status, WUNTRACED)) {
1345+
result = FALSE;
1346+
} else {
1347+
//printf("status: %i WIFEXITED: %i WEXITSTATUS: %i\n", status, WIFEXITED(status), WEXITSTATUS(status) );
1348+
result = WIFEXITED(status)
13491349
&& (WEXITSTATUS(status) == 0);
1350-
}
1350+
}
13511351
}
13521352

13531353
return result;

0 commit comments

Comments
 (0)