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:
@ -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
|
||||
|
||||
@ -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))
|
||||
|
||||
Reference in New Issue
Block a user