From 48696d8c955db9d0621812aca7ef5caac727da31 Mon Sep 17 00:00:00 2001 From: FRIGN Date: Sun, 1 Mar 2015 23:48:50 +0100 Subject: [PATCH] Fix exit status with -f for nonexistent paths Thanks Michael Forney for reporting this! --- libutil/rm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libutil/rm.c b/libutil/rm.c index 53ae3f2..aa6648b 100644 --- a/libutil/rm.c +++ b/libutil/rm.c @@ -1,4 +1,5 @@ /* See LICENSE file for copyright and license details. */ +#include #include #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); } }