From a99617fe8fdb56b3e877558bfd6572ce65ad39de Mon Sep 17 00:00:00 2001 From: Eric Andersen Date: Wed, 11 Oct 2000 23:54:37 +0000 Subject: Finish reorganizing things. At least I think I've finished. --- libc/stdio/remove.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 libc/stdio/remove.c (limited to 'libc/stdio/remove.c') diff --git a/libc/stdio/remove.c b/libc/stdio/remove.c new file mode 100644 index 000000000..115b871bb --- /dev/null +++ b/libc/stdio/remove.c @@ -0,0 +1,23 @@ +/* Copyright (C) 1995,1996 Robert de Bath + * This file is part of the Linux-8086 C library and is distributed + * under the GNU Library General Public License. + */ +#include +#include +#include +#include + +int remove(src) +__const char *src; +{ + extern int errno; + int er = errno; + int rv = unlink(src); + + if (rv < 0 && errno == EISDIR) + rv = rmdir(src); + if (rv >= 0) + errno = er; + return rv; +} + -- cgit v1.2.3