diff options
author | Andy Broad <andy@broad.ology.org.uk> | 2015-08-31 12:20:52 -0400 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2015-09-05 11:12:46 -0400 |
commit | 5cdd1fc248450d983728d1d34020af9242860e12 (patch) | |
tree | 577b98fdf64c875a0f1cfeec5af1e59ff961bd4f /doio.c | |
parent | 53f73940f58aac9347477bba3db29ef6b23ad573 (diff) | |
download | perl-5cdd1fc248450d983728d1d34020af9242860e12.tar.gz |
amigaos4: unlink of open/locked files will fail
Diffstat (limited to 'doio.c')
-rw-r--r-- | doio.c | 30 |
1 files changed, 29 insertions, 1 deletions
@@ -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 } } } |