summaryrefslogtreecommitdiffstats
path: root/mdk-stage1/dietlibc/lib/remove.c
blob: d5125bfed49ffbbc2f95de463564db564fb06409 (plain)
1
2
3
4
5
6
7
8
9
10
11
#include <unistd.h>
#include <errno.h>

int remove(const char* filename) {
  if (unlink(filename)) {
    if (errno==EISDIR)
      return rmdir(filename);
    return -1;
  }
  return 0;
}