]> pd.if.org Git - pdclib/blobdiff - platform/example/functions/_PDCLIB/rename.c
Whitespace cleanups.
[pdclib] / platform / example / functions / _PDCLIB / rename.c
index f314e4c5186cdba5b8e635f6ee3a915900c95c0e..f1fc38245814facd9d210eb2cfe0149d818cdf27 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id$ */
-
 /* _PDCLIB_rename( const char *, const char * )
 
    This file is part of the Public Domain C Library (PDCLib).
@@ -9,7 +7,8 @@
 #include <stdio.h>
 
 #ifndef REGTEST
-#include <_PDCLIB_glue.h>
+
+#include "_PDCLIB_glue.h"
 
 #include </usr/include/errno.h>
 
@@ -29,6 +28,9 @@ int _PDCLIB_rename( const char * old, const char * new )
         {
             switch ( errno )
             {
+                /* See the comments on implementation-defined errno values in
+                   <_PDCLIB_config.h>.
+                */
                 case EACCES:
                 case EFAULT:
                 case EIO:
@@ -40,10 +42,11 @@ int _PDCLIB_rename( const char * old, const char * new )
                 case ENOTDIR:
                 case EPERM:
                 case EROFS:
-                    _PDCLIB_errno = _PDCLIB_EIO;
+                    _PDCLIB_errno = _PDCLIB_ERROR;
                     break;
                 default:
-                    _PDCLIB_errno = _PDCLIB_EUNKNOWN;
+                    /* This should be something like EUNKNOWN. */
+                    _PDCLIB_errno = _PDCLIB_ERROR;
                     break;
             }
             return -1;
@@ -57,6 +60,9 @@ int _PDCLIB_rename( const char * old, const char * new )
     {
         switch ( errno )
         {
+            /* See the comments on implementation-defined errno values in
+               <_PDCLIB_config.h>.
+            */
             case EACCES:
             case EEXIST:
             case EFAULT:
@@ -71,10 +77,11 @@ int _PDCLIB_rename( const char * old, const char * new )
             case EPERM:
             case EROFS:
             case EXDEV:
-                _PDCLIB_errno = _PDCLIB_EIO;
+                _PDCLIB_errno = _PDCLIB_ERROR;
                 break;
             default:
-                _PDCLIB_errno = _PDCLIB_EUNKNOWN;
+                /* This should be something like EUNKNOWN. */
+                _PDCLIB_errno = _PDCLIB_ERROR;
                 break;
         }
         return EOF;
@@ -84,12 +91,13 @@ int _PDCLIB_rename( const char * old, const char * new )
 #endif
 
 #ifdef TEST
-#include <_PDCLIB_test.h>
+#include "_PDCLIB_test.h"
 
 #include <stdlib.h>
 
 int main( void )
 {
+#ifndef REGTEST
     FILE * file;
     remove( testfile1 );
     remove( testfile2 );
@@ -125,6 +133,7 @@ int main( void )
     /* remove both files */
     remove( testfile1 );
     remove( testfile2 );
+#endif
     return TEST_RESULTS;
 }