X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=platform%2Fposix%2Ffunctions%2F_PDCLIB%2F_PDCLIB_rename.c;fp=platform%2Fposix%2Ffunctions%2F_PDCLIB%2Frename.c;h=cc5a17392d1f9d8ef99822a759f6a8d1acedfd1e;hb=1aba8d4e33b2a020709f81182709c7de7a728c76;hp=a37eeb3464ed74a22d30a4ee4fbd7280479b1a8c;hpb=f473bc71fc1f79bf2ef549c768852c6216784e23;p=pdclib diff --git a/platform/posix/functions/_PDCLIB/rename.c b/platform/posix/functions/_PDCLIB/_PDCLIB_rename.c similarity index 62% rename from platform/posix/functions/_PDCLIB/rename.c rename to platform/posix/functions/_PDCLIB/_PDCLIB_rename.c index a37eeb3..cc5a173 100644 --- a/platform/posix/functions/_PDCLIB/rename.c +++ b/platform/posix/functions/_PDCLIB/_PDCLIB_rename.c @@ -27,29 +27,6 @@ int _PDCLIB_rename( const char * old, const char * new ) { if ( unlink( old ) == EOF ) { - switch ( errno ) - { - /* See the comments on implementation-defined errno values in - <_PDCLIB_config.h>. - */ - case EACCES: - case EFAULT: - case EIO: - case EISDIR: - case ELOOP: - case ENAMETOOLONG: - case ENOENT: - case ENOMEM: - case ENOTDIR: - case EPERM: - case EROFS: - _PDCLIB_errno = _PDCLIB_ERROR; - break; - default: - /* This should be something like EUNKNOWN. */ - _PDCLIB_errno = _PDCLIB_ERROR; - break; - } return -1; } else @@ -59,32 +36,6 @@ int _PDCLIB_rename( const char * old, const char * new ) } else { - switch ( errno ) - { - /* See the comments on implementation-defined errno values in - <_PDCLIB_config.h>. - */ - case EACCES: - case EEXIST: - case EFAULT: - case EIO: - case ELOOP: - case EMLINK: - case ENAMETOOLONG: - case ENOENT: - case ENOMEM: - case ENOSPC: - case ENOTDIR: - case EPERM: - case EROFS: - case EXDEV: - _PDCLIB_errno = _PDCLIB_ERROR; - break; - default: - /* This should be something like EUNKNOWN. */ - _PDCLIB_errno = _PDCLIB_ERROR; - break; - } return EOF; } } @@ -98,6 +49,7 @@ int _PDCLIB_rename( const char * old, const char * new ) int main( void ) { +#ifndef REGTEST FILE * file; remove( testfile1 ); remove( testfile2 ); @@ -133,6 +85,7 @@ int main( void ) /* remove both files */ remove( testfile1 ); remove( testfile2 ); +#endif return TEST_RESULTS; }