X-Git-Url: https://pd.if.org/git/?p=pdclib;a=blobdiff_plain;f=platform%2Fexample%2Ffunctions%2F_PDCLIB%2Frename.c;h=8ae31f6b517204f56047d77a43a3f838b362700b;hp=6b7ecf19d4a2e8ef91c0d0c2ad65b9a7215cdb1f;hb=da0f3f353d417fed71f358a48d5d5394145e460d;hpb=05c4ae55c5ed3a2a4e877a723e58e7ffc92110d4 diff --git a/platform/example/functions/_PDCLIB/rename.c b/platform/example/functions/_PDCLIB/rename.c index 6b7ecf1..8ae31f6 100644 --- a/platform/example/functions/_PDCLIB/rename.c +++ b/platform/example/functions/_PDCLIB/rename.c @@ -1,42 +1,29 @@ -/* $Id$ */ - /* _PDCLIB_rename( const char *, const char * ) This file is part of the Public Domain C Library (PDCLib). Permission is granted to use, modify, and / or redistribute at will. */ +#include + #ifndef REGTEST -#include -#include <_PDCLIB_glue.h> +#include "_PDCLIB_glue.h" +#include int _PDCLIB_rename( const char * old, const char * new ) { - /* Note that the behaviour if new file exists is implementation-defined. - There is nothing wrong with either overwriting it or failing the - operation, but you might want to document whichever you chose. - This example fails if new file exists. - */ - if ( link( old, new ) == 0 ) - { - return unlink( old ); - } - else - { - return -1; - } + errno = ENOTSUP; } #endif #ifdef TEST -/* TODO: Work around the following undef */ -#undef SEEK_SET -#include <_PDCLIB_test.h> +#include "_PDCLIB_test.h" + +#include int main( void ) { - TESTCASE( NO_TESTDRIVER ); return TEST_RESULTS; }