---
 find.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/find.c b/find.c
index 7243072..ce551e5 100644
--- a/find.c
+++ b/find.c
@@ -960,6 +960,7 @@ find(char *path, struct findhist *hist)
 
        if (do_stat(path, &st, hist) < 0) {
                weprintf("failed to stat %s:", path);
+               gflags.ret = 1;
                return;
        }
 
@@ -981,6 +982,7 @@ find(char *path, struct findhist *hist)
        for (f = hist; f; f = f->next) {
                if (f->dev == st.st_dev && f->ino == st.st_ino) {
                        weprintf("loop detected '%s' is '%s'\n", path, f->path);
+                       gflags.ret = 1;
                        return;
                }
        }
@@ -991,6 +993,7 @@ find(char *path, struct findhist *hist)
 
        if (!(dir = opendir(path))) {
                weprintf("failed to opendir %s:", path);
+               gflags.ret = 1;
                /* should we just ignore this since we hit an error? */
                if (gflags.depth)
                        eval(root, &arg);
@@ -1014,6 +1017,7 @@ find(char *path, struct findhist *hist)
        free(pathbuf);
        if (errno) {
                weprintf("readdir %s:", path);
+               gflags.ret = 1;
                closedir(dir);
                return;
        }
-- 
2.48.1


Reply via email to