---
Whoops, just realized that simply using the errno from the remove call is way
simpler.
libutil/rm.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/libutil/rm.c b/libutil/rm.c
index 53ae3f2..54987e5 100644
--- a/libutil/rm.c
+++ b/libutil/rm.c
_AT_@ -1,4 +1,5 @@
/* See LICENSE file for copyright and license details. */
+#include <errno.h>
#include <stdio.h>
#include "../fs.h"
_AT_@ -14,8 +15,9 @@ rm(const char *path, int unused)
if (rm_rflag)
recurse(path, rm, 'P');
if (remove(path) < 0) {
+ if (!rm_fflag || errno != ENOENT)
+ rm_status = 1;
if (!rm_fflag)
weprintf("remove %s:", path);
- rm_status = 1;
}
}
--
2.1.3.1.g339ec9c
Received on Sun Mar 01 2015 - 22:59:02 CET
This archive was generated by hypermail 2.3.0 : Sun Mar 01 2015 - 23:12:07 CET