X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=platform%2Fposix%2Ffunctions%2Fstdio%2Fremove.c;fp=platform%2Fexample_cygwin%2Ffunctions%2Fstdio%2Fremove.c;h=389df301be224d6945d6b8a250f7e31a82ca7543;hb=a18343e497615802f47e0f6876b5bed73af674e0;hp=e27dd56efe2cfcfc83167a9cfb87753ea5797c13;hpb=b76c255d42904c10ce65f884429b4bf2f9b4f4a4;p=pdclib diff --git a/platform/example_cygwin/functions/stdio/remove.c b/platform/posix/functions/stdio/remove.c similarity index 79% rename from platform/example_cygwin/functions/stdio/remove.c rename to platform/posix/functions/stdio/remove.c index e27dd56..389df30 100644 --- a/platform/example_cygwin/functions/stdio/remove.c +++ b/platform/posix/functions/stdio/remove.c @@ -13,13 +13,26 @@ #ifndef REGTEST +#include + #include "/usr/include/errno.h" +extern struct _PDCLIB_file_t * _PDCLIB_filelist; + extern int unlink( const char * pathname ); int remove( const char * pathname ) { int rc; + struct _PDCLIB_file_t * current = _PDCLIB_filelist; + while ( current != NULL ) + { + if ( ( current->filename != NULL ) && ( strcmp( current->filename, pathname ) == 0 ) ) + { + return EOF; + } + current = current->next; + } if ( ( rc = unlink( pathname ) ) == -1 ) { switch ( errno )