summaryrefslogtreecommitdiffstats
path: root/usr/klibc/remove.c
blob: 90882045d8a3765a856b2766d16f2b14601ad78c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
/*
 * remove.c
 */

#include <stdio.h>
#include <unistd.h>
#include <errno.h>

int remove(const char *pathname)
{
	int rv;

	rv = unlink(pathname);
	if (rv == -1 && errno == EISDIR)
		return rmdir(pathname);

	return rv;
}