diff options
author | midipix <writeonce@midipix.org> | 2019-12-26 12:18:19 +0000 |
---|---|---|
committer | midipix <writeonce@midipix.org> | 2019-12-26 12:18:19 +0000 |
commit | 3f4643fd2e481b164bef505c9bd89bd50ecf0a2f (patch) | |
tree | d26f5707eaa5fcdb6cdab0518768d77665a71397 /src | |
parent | 8744a55869e9d0288bebf8f340d5186dc99922e9 (diff) | |
download | sltdl-3f4643fd2e481b164bef505c9bd89bd50ecf0a2f.tar.bz2 sltdl-3f4643fd2e481b164bef505c9bd89bd50ecf0a2f.tar.xz |
lt_dlpathopen(): support systems that lack a definition for O_EXEC.
Diffstat (limited to 'src')
-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) { |