diff options
-rw-r--r-- | src/core/lt_path.c | 8 |
1 files changed, 7 insertions, 1 deletions
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) { |