X-Git-Url: https://pd.if.org/git/?p=pdclib;a=blobdiff_plain;f=platform%2Fexample%2Ffunctions%2Fstdio%2Fremove.c;h=8bf3040cf03c9f821f68ecff2325a7c63b4e66af;hp=0e66f4c65c6cb3124f51fcbc8105fe793174f405;hb=b189506b1b895940933bdfc5d6d6ae5d0ba65721;hpb=29510491be6e3e0b95872920c371024ed444c1e5 diff --git a/platform/example/functions/stdio/remove.c b/platform/example/functions/stdio/remove.c index 0e66f4c..8bf3040 100644 --- a/platform/example/functions/stdio/remove.c +++ b/platform/example/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 )