X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=platform%2Fexample%2Ffunctions%2F_PDCLIB%2Frename.c;h=6ce45811b0dd7fdd97d4d440c42ef83c73d84ff0;hb=d6f1494a4f38a212b29a13ee713885058dcf0fe7;hp=f314e4c5186cdba5b8e635f6ee3a915900c95c0e;hpb=0326491c5ed243ea6efc5e66e3a6ea21427aad92;p=pdclib diff --git a/platform/example/functions/_PDCLIB/rename.c b/platform/example/functions/_PDCLIB/rename.c index f314e4c..6ce4581 100644 --- a/platform/example/functions/_PDCLIB/rename.c +++ b/platform/example/functions/_PDCLIB/rename.c @@ -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,7 @@ #include #ifndef REGTEST -#include <_PDCLIB_glue.h> +#include "_PDCLIB_glue.h" #include @@ -29,6 +27,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 +41,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 +59,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 +76,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 +90,13 @@ int _PDCLIB_rename( const char * old, const char * new ) #endif #ifdef TEST -#include <_PDCLIB_test.h> +#include "_PDCLIB_test.h" #include int main( void ) { +#ifndef REGTEST FILE * file; remove( testfile1 ); remove( testfile2 ); @@ -125,6 +132,7 @@ int main( void ) /* remove both files */ remove( testfile1 ); remove( testfile2 ); +#endif return TEST_RESULTS; }