]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
(process_entry): Handle FTW_DCHP.
authorJim Meyering <jim@meyering.net>
Wed, 22 Jan 2003 15:45:48 +0000 (15:45 +0000)
committerJim Meyering <jim@meyering.net>
Wed, 22 Jan 2003 15:45:48 +0000 (15:45 +0000)
(ftw_dir): Handle FTW_DCH.

lib/ftw.c

index 3fe76d1cd99913f77406d07e89c2efbf315efac7..0843c11cfa252f7de32d84da2a71a16610c71099 100644 (file)
--- a/lib/ftw.c
+++ b/lib/ftw.c
@@ -398,6 +398,12 @@ process_entry (struct ftw_data *data, struct dir_data *dir, const char *name,
                        if (__chdir ("..") < 0)
                          result = -1;
                    }
+
+                 if (result < 0)
+                   {
+                     result = (*data->func) (data->dirbuf, NULL, FTW_DCHP,
+                               &data->ftw);
+                   }
                }
            }
        }
@@ -464,6 +470,10 @@ ftw_dir (struct ftw_data *data, struct STAT *st)
            data->actdir = data->maxdir - 1;
          data->dirstreams[data->actdir] = NULL;
 
+         /* We cannot change to the directory.
+            Signal this with a special flag.  */
+         result = (*data->func) (data->dirbuf, st, FTW_DCH, &data->ftw);
+
          return result;
        }
     }