isblank() implementation.
[minix.git] / lib / libc / stdio / remove.c
blob7c985ba5920b0aa9e7664f4b94359e6d47bf98b8
1 /*
2 * remove.c - remove a file
3 */
4 /* $Header$ */
6 #include <stdio.h>
7 #include <errno.h>
9 int _rmdir(const char *path);
10 int _unlink(const char *path);
12 int
13 remove(const char *filename) {
14 int saved_errno, retval;
16 saved_errno = errno;
18 retval = _rmdir(filename);
20 if (retval == -1 && errno == ENOTDIR) {
21 errno = saved_errno;
23 retval = _unlink(filename);
26 return retval;