aboutsummaryrefslogtreecommitdiffstats
path: root/ports/unix/guts/remove.c
blob: 4e2cecbf9eb76ac3ea5561877baf762794121704 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/* 
 * Copyright (c) 2008-2010, 2012 Wind River Systems; see
 * guts/COPYRIGHT for information.
 *
 * static int
 * wrap_remove(const char *path) {
 *	int rc = -1;
 */
	PSEUDO_STATBUF buf;
	if (base_lstat(path, &buf) == -1) {
		errno = ENOENT;
		return -1;
	}
	if (S_ISDIR(buf.st_mode)) {
		rc = wrap_rmdir(path);
	} else {
		rc = wrap_unlink(path);
	}

/*	return rc;
 * }
 */