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

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