This probably uses `stat` under the hood too, but is slightly more concise and
clear about intent.
#include <stdbool.h>
#include <stddef.h>
#include <string.h>
-#include <sys/types.h>
-#include <sys/stat.h>
+#include <unistd.h>
#ifdef ENABLE_LTDL
#include <ltdl.h>
static size_t lenp;
char *libdir;
char *suffix = "_LTX_library";
- struct stat sb;
if (!gvc->common.demand_loading)
return NULL;
}
hndl = lt_dlopen(p);
if (!hndl) {
- if (stat(p, &sb) == 0) {
+ if (access(p, R_OK) == 0) {
agerr(AGWARN, "Could not load \"%s\" - %s\n", p, "It was found, so perhaps one of its dependents was not. Try ldd.");
}
else {