aboutsummaryrefslogtreecommitdiffstats
path: root/ports/unix/guts/remove.c
blob: 375e648c4187e8522f8c351ede0732e9f9f56297 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/* 
 * Copyright (c) 2008-2010, 2012 Wind River Systems; see
 * guts/COPYRIGHT for information.
 *
 * SPDX-License-Identifier: LGPL-2.1-only
 *
 * 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;
 * }
 */