1
0
mirror of https://github.com/adtools/clib2.git synced 2025-12-08 14:59:05 +00:00

- Reversed the change in rename() which enforced deletion of the target file.

git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14921 87f5fb63-7c3d-0410-a384-fd976d0f7a62
This commit is contained in:
Olaf Barthel
2005-04-21 10:23:17 +00:00
parent 2e9ac7d003
commit a50aba0b64
2 changed files with 4 additions and 28 deletions

View File

@ -1,7 +1,3 @@
- The Unix-like rename() now removes the target file even if that
file has been protected from deletion.
c.lib 1.191 (9.4.2005)
- The name of the public record locking semaphore has to be preallocated

View File

@ -1,5 +1,5 @@
/*
* $Id: stdio_rename.c,v 1.5 2005-04-20 12:06:00 obarthel Exp $
* $Id: stdio_rename.c,v 1.6 2005-04-21 10:23:17 obarthel Exp $
*
* :ts=4
*
@ -123,30 +123,10 @@ rename(const char *oldname,const char *newname)
if(CANNOT DeleteFile((STRPTR)newname))
{
error = IoErr();
if(error != ERROR_DELETE_PROTECTED && error != ERROR_OBJECT_NOT_FOUND)
{
SHOWMS("couldn't delete the file");
SHOWMS("couldn't delete the file");
__set_errno(__translate_io_error_to_errno(error));
goto out;
}
if(CANNOT SetProtection((STRPTR)newname,0))
{
SHOWMS("couldn't reset the protection");
__set_errno(__translate_io_error_to_errno(IoErr()));
goto out;
}
if(CANNOT DeleteFile((STRPTR)newname))
{
SHOWMS("couldn't delete the file again");
__set_errno(__translate_io_error_to_errno(IoErr()));
goto out;
}
__set_errno(__translate_io_error_to_errno(error));
goto out;
}
if(CANNOT Rename((STRPTR)oldname,(STRPTR)newname))