commit 48696d8c955db9d0621812aca7ef5caac727da31
parent 80d89c400fa3f10afdaa1c4c50a1ae60e514a4c5
Author: FRIGN <dev@frign.de>
Date: Sun, 1 Mar 2015 23:48:50 +0100
Fix exit status with -f for nonexistent paths
Thanks Michael Forney <mforney@mforney.org> for reporting this!
Diffstat:
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/libutil/rm.c b/libutil/rm.c
@@ -1,4 +1,5 @@
/* See LICENSE file for copyright and license details. */
+#include <errno.h>
#include <stdio.h>
#include "../fs.h"
@@ -16,6 +17,6 @@ rm(const char *path, int unused)
if (remove(path) < 0) {
if (!rm_fflag)
weprintf("remove %s:", path);
- rm_status = 1;
+ rm_status = !(rm_fflag && errno == ENOENT);
}
}