Fix exit status with -f for nonexistent paths
Thanks Michael Forney <mforney@mforney.org> for reporting this!
This commit is contained in:
parent
80d89c400f
commit
48696d8c95
|
@ -1,4 +1,5 @@
|
||||||
/* See LICENSE file for copyright and license details. */
|
/* See LICENSE file for copyright and license details. */
|
||||||
|
#include <errno.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
#include "../fs.h"
|
#include "../fs.h"
|
||||||
|
@ -16,6 +17,6 @@ rm(const char *path, int unused)
|
||||||
if (remove(path) < 0) {
|
if (remove(path) < 0) {
|
||||||
if (!rm_fflag)
|
if (!rm_fflag)
|
||||||
weprintf("remove %s:", path);
|
weprintf("remove %s:", path);
|
||||||
rm_status = 1;
|
rm_status = !(rm_fflag && errno == ENOENT);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user