summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2018-08-13 22:47:42 -0400
committermidipix <writeonce@midipix.org>2018-08-13 22:50:05 -0400
commitcb91195c9bb14d3381aac4d74bff5c695a5cb6b4 (patch)
tree5e22c5ed605d6cf6bee81c7a2f832d9b26803350 /src
parent267766528f3196c8de23613c7896246d745db4e5 (diff)
downloadslibtool-cb91195c9bb14d3381aac4d74bff5c695a5cb6b4.tar.bz2
slibtool-cb91195c9bb14d3381aac4d74bff5c695a5cb6b4.tar.xz
internals: slbt_adjust_linker_argument() now uses the context's fdcwd.
Diffstat (limited to 'src')
-rw-r--r--src/logic/slbt_exec_link.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/logic/slbt_exec_link.c b/src/logic/slbt_exec_link.c
index 8461bcb..20982c0 100644
--- a/src/logic/slbt_exec_link.c
+++ b/src/logic/slbt_exec_link.c
@@ -259,6 +259,7 @@ static int slbt_adjust_linker_argument(
const char * arsuffix,
struct slbt_deps_meta * depsmeta)
{
+ int fdcwd;
int fdlib;
char * slash;
char * dot;
@@ -295,13 +296,16 @@ static int slbt_adjust_linker_argument(
dot = strrchr(arg,'.');
}
+ /* fdcwd */
+ fdcwd = slbt_driver_fdcwd(dctx);
+
/* shared library dependency? */
if (fpic) {
sprintf(dot,"%s",dsosuffix);
if (slbt_symlink_is_a_placeholder(arg))
sprintf(dot,"%s",arsuffix);
- else if ((fdlib = open(arg,O_RDONLY)) >= 0)
+ else if ((fdlib = openat(fdcwd,arg,O_RDONLY)) >= 0)
close(fdlib);
else
sprintf(dot,"%s",arsuffix);
@@ -400,7 +404,7 @@ static int slbt_exec_link_adjust_argument_vector(
else
strcpy(mark,"/.libs");
- if ((fd = open(ldir,O_DIRECTORY,0)) < 0)
+ if ((fd = openat(fdcwd,ldir,O_DIRECTORY,0)) < 0)
*mark = 0;
else
close(fd);