e60885699c
by setting rm_status to 1 if removing 1 file in the list fails. Extend this to mv_status in mv(1).
22 lines
336 B
C
22 lines
336 B
C
/* See LICENSE file for copyright and license details. */
|
|
#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)
|
|
{
|
|
if (rm_rflag)
|
|
recurse(path, rm);
|
|
if (remove(path) < 0) {
|
|
if (!rm_fflag)
|
|
weprintf("remove %s:", path);
|
|
rm_status = 1;
|
|
}
|
|
}
|