]> pd.if.org Git - pdclib.old/blobdiff - platform/posix/functions/_PDCLIB/_PDCLIB_rename.c
Add an up to date POSIX port (works on Mac OS X). This is fully functional except...
[pdclib.old] / 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 a37eeb3464ed74a22d30a4ee4fbd7280479b1a8c..cc5a17392d1f9d8ef99822a759f6a8d1acedfd1e 100644 (file)
@@ -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;
 }