X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=src%2Fincremen.c;h=69cbd59a470687af78ba9623c8e5696853b9fa90;hb=d88b2a613f4b1a5554e8c34c8f75b91abff5f0e9;hp=b2ab5bf0557e6331e9a612e010e5410cabe0dfdb;hpb=1e1fc0336bea2f273b8c6fdb376735ce13887899;p=chaz%2Ftar diff --git a/src/incremen.c b/src/incremen.c index b2ab5bf..69cbd59 100644 --- a/src/incremen.c +++ b/src/incremen.c @@ -300,6 +300,24 @@ dirlist_replace_prefix (const char *pref, const char *repl) replace_prefix (&dp->name, pref, pref_len, repl, repl_len); } +void +clear_directory_table (void) +{ + struct directory *dp; + + if (directory_table) + hash_clear (directory_table); + if (directory_meta_table) + hash_clear (directory_meta_table); + for (dp = dirhead; dp; ) + { + struct directory *next = dp->next; + free_directory (dp); + dp = next; + } + dirhead = dirtail = NULL; +} + /* Create and link a new directory entry for directory NAME, having a device number DEV and an inode number INO, with NFS indicating whether it is an NFS device and FOUND indicating whether we have @@ -327,7 +345,8 @@ note_directory (char const *name, struct timespec mtime, if (! ((directory_table || (directory_table = hash_initialize (0, 0, hash_directory_canonical_name, - compare_directory_canonical_names, 0))) + compare_directory_canonical_names, + 0))) && hash_insert (directory_table, directory))) xalloc_die ();