summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2018-07-31 09:47:42 +0000
committermidipix <writeonce@midipix.org>2018-08-03 21:13:30 -0400
commit4f02be2a288345cf26aab420d456fadd247c7dae (patch)
tree4cafe290c244ea87a9e4d32570fa7ba12f55e0a2 /src
parente01b88a1f828d670fa9b2ce086631db0af235d21 (diff)
downloadmdso-4f02be2a288345cf26aab420d456fadd247c7dae.tar.bz2
mdso-4f02be2a288345cf26aab420d456fadd247c7dae.tar.xz
mdso_map_input(): use openat and the context's fdcwd.
Diffstat (limited to 'src')
-rw-r--r--src/helper/mdso_map_input.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/helper/mdso_map_input.c b/src/helper/mdso_map_input.c
index 090de12..ab4607f 100644
--- a/src/helper/mdso_map_input.c
+++ b/src/helper/mdso_map_input.c
@@ -13,6 +13,7 @@
#include <sys/stat.h>
#include <mdso/mdso.h>
+#include "mdso_driver_impl.h"
#include "mdso_errinfo_impl.h"
int mdso_map_input(
@@ -22,12 +23,15 @@ int mdso_map_input(
int prot,
struct mdso_input * map)
{
+ int ret;
struct stat st;
bool fnew;
- int ret;
+ int fdcwd;
+
+ fdcwd = mdso_driver_fdcwd(dctx);
if ((fnew = (fd < 0)))
- fd = open(path,O_RDONLY | O_CLOEXEC);
+ fd = openat(fdcwd,path,O_RDONLY | O_CLOEXEC);
if (fd < 0)
return MDSO_SYSTEM_ERROR(dctx);