From 3f4643fd2e481b164bef505c9bd89bd50ecf0a2f Mon Sep 17 00:00:00 2001 From: midipix Date: Dec 26 2019 12:18:19 +0000 Subject: lt_dlpathopen(): support systems that lack a definition for O_EXEC. --- diff --git a/src/core/lt_path.c b/src/core/lt_path.c index 06252a4..715b470 100644 --- a/src/core/lt_path.c +++ b/src/core/lt_path.c @@ -17,6 +17,12 @@ #include "sltdl_core.h" #include "sltdl_module.h" +#ifdef O_EXEC +#define SLTDL_MODULE_OPEN_OPTIONS (O_CLOEXEC|O_EXEC) +#else +#define SLTDL_MODULE_OPEN_OPTIONS (O_CLOEXEC) +#endif + static int lt_status; static off_t lt_plen; static off_t lt_plocs; @@ -298,7 +304,7 @@ static int lt_dlpathopen_locked( memcpy(&path[mlen],*pext,elen); path[mlen+elen] = 0; - fdmod = openat(fdat,path,O_EXEC|O_CLOEXEC,0); + fdmod = openat(fdat,path,SLTDL_MODULE_OPEN_OPTIONS,0); if (fdmod >= 0) { if (mpath) {