summaryrefslogtreecommitdiff
path: root/src/internal
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2024-03-04 05:49:35 +0000
committermidipix <writeonce@midipix.org>2024-03-04 05:49:35 +0000
commita06474266cbd66d534cd2b3a7736a2961cd62ed3 (patch)
tree3069f4c9d73457d541658a1b361bc7170f2aea1b /src/internal
parent04fb2ee8f202dccf309f3c75d7769c6f93bd8ec2 (diff)
downloadslibtool-a06474266cbd66d534cd2b3a7736a2961cd62ed3.tar.bz2
slibtool-a06474266cbd66d534cd2b3a7736a2961cd62ed3.tar.xz
link mode: refined .disabled placeholder logic (/dev/null <--> older linkers).
Diffstat (limited to 'src/internal')
-rw-r--r--src/internal/slibtool_symlink_impl.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/internal/slibtool_symlink_impl.c b/src/internal/slibtool_symlink_impl.c
index 34661f0..019d3d6 100644
--- a/src/internal/slibtool_symlink_impl.c
+++ b/src/internal/slibtool_symlink_impl.c
@@ -78,7 +78,14 @@ slbt_hidden int slbt_create_symlink(
lnkname) <0)
return SLBT_BUFFER_ERROR(dctx);
+ /* fdcwd */
+ fdcwd = slbt_driver_fdcwd(dctx);
+
/* placeholder? */
+ if (fdevnull)
+ if (unlinkat(fdcwd,lnkname,0) && (errno != ENOENT))
+ return SLBT_SYSTEM_ERROR(dctx,0);
+
if (suffix) {
sprintf(alnkarg,"%s%s",lnkname,suffix);
lnkname = alnkarg;
@@ -115,9 +122,6 @@ slbt_hidden int slbt_create_symlink(
/* restore execution context */
ectx->argv = oargv;
- /* fdcwd */
- fdcwd = slbt_driver_fdcwd(dctx);
-
/* create symlink */
if (symlinkat(atarget,fdcwd,tmplnk))
return SLBT_SYSTEM_ERROR(dctx,tmplnk);