933ed8c00b
Before somebody gets the wrong idea again like I did.
24 lines
409 B
C
24 lines
409 B
C
/* See LICENSE file for copyright and license details. */
|
|
#include <errno.h>
|
|
#include <stdio.h>
|
|
|
|
#include "../fs.h"
|
|
#include "../util.h"
|
|
|
|
int rm_fflag = 0;
|
|
int rm_rflag = 0;
|
|
int rm_status = 0;
|
|
|
|
void
|
|
rm(const char *path, int flag)
|
|
{
|
|
if (rm_rflag)
|
|
recurse(path, rm, 'P');
|
|
if (remove(path) < 0) {
|
|
if (!rm_fflag)
|
|
weprintf("remove %s:", path);
|
|
if (!(rm_fflag && errno == ENOENT))
|
|
rm_status = 1;
|
|
}
|
|
}
|