]> git.sesse.net Git - betaftpd/blobdiff - cmds.c
Added a notice about a (not yet fixed) dcache bug.
[betaftpd] / cmds.c
diff --git a/cmds.c b/cmds.c
index 4f05b88018d09fb3a06f2d7694be3254d1e866c5..a2e047bc51eef0a54ffc3d8d46ea4f74c74108ba 100644 (file)
--- a/cmds.c
+++ b/cmds.c
 #include <cmds.h>
 #include <nonroot.h>
 
+#if WANT_DCACHE
+#include <dcache.h>
+#endif
+
 #define lstat stat
 
 extern struct conn *first_conn;
@@ -1226,23 +1230,7 @@ void do_listing(struct conn * const c, struct list_options * const lo)
 #endif
 
 #if WANT_DCACHE
-       /* populate the directory listing cache */
-       {
-               struct stat buf;
-               struct dcache *d = alloc_new_dcache();
-               if (d != NULL && stat(cwd, &buf) > -1) {
-                       d->use_count++;
-                       f->dir_cache = d;
-                       d->dir_data = f->file_data;
-                       d->dir_size = f->size;
-                       d->generated = buf.st_mtime;
-
-                       strcpy(d->dir_name, cwd);
-                       strncpy(d->pattern, ptr, 255);
-                       d->pattern[255] = 0;
-                       d->lo = *lo;
-               }
-       }
+       populate_dcache(f, cwd, ptr, lo);
 #endif
 
 #if HAVE_MMAP