summaryrefslogtreecommitdiff
path: root/doio.c
diff options
context:
space:
mode:
authorAndy Broad <andy@broad.ology.org.uk>2015-08-31 12:20:52 -0400
committerJarkko Hietaniemi <jhi@iki.fi>2015-09-05 11:12:46 -0400
commit5cdd1fc248450d983728d1d34020af9242860e12 (patch)
tree577b98fdf64c875a0f1cfeec5af1e59ff961bd4f /doio.c
parent53f73940f58aac9347477bba3db29ef6b23ad573 (diff)
downloadperl-5cdd1fc248450d983728d1d34020af9242860e12.tar.gz
amigaos4: unlink of open/locked files will fail
Diffstat (limited to 'doio.c')
-rw-r--r--doio.c30
1 files changed, 29 insertions, 1 deletions
diff --git a/doio.c b/doio.c
index f41a559ce4..b2d269b908 100644
--- a/doio.c
+++ b/doio.c
@@ -1975,7 +1975,21 @@ nothing in the core.
}
else if (PL_unsafe) {
if (UNLINK(s))
+ {
tot--;
+ }
+#if defined(__amigaos4__) && defined(NEWLIB)
+ else
+ {
+ /* Under AmigaOS4 unlink only 'fails' if the
+ * filename is invalid. It may not remove the file
+ * if it's locked, so check if it's still around. */
+ if ((access(s,F_OK) != -1))
+ {
+ tot--;
+ }
+ }
+#endif
}
else { /* don't let root wipe out directories without -U */
if (PerlLIO_lstat(s,&PL_statbuf) < 0)
@@ -1986,7 +2000,21 @@ nothing in the core.
}
else {
if (UNLINK(s))
- tot--;
+ {
+ tot--;
+ }
+#if defined(__amigaos4__) && defined(NEWLIB)
+ else
+ {
+ /* Under AmigaOS4 unlink only 'fails' if the filename is invalid */
+ /* It may not remove the file if it's Locked, so check if it's still */
+ /* arround */
+ if((access(s,F_OK) != -1))
+ {
+ tot--;
+ }
+ }
+#endif
}
}
}