]> arthur.barton.de Git - netatalk.git/blobdiff - etc/afpd/filedir.c
Merge branch-2-1
[netatalk.git] / etc / afpd / filedir.c
index fd7cc8899e46283f3c90cf8c3972dbb1f0cf711e..bf3a8c0681c1fea7b5ab371ef53a923923716998 100644 (file)
@@ -43,6 +43,7 @@ char *strchr (), *strrchr ();
 #include <atalk/bstradd.h>
 
 #include "directory.h"
+#include "dircache.h"
 #include "desktop.h"
 #include "volume.h"
 #include "fork.h"
@@ -581,6 +582,12 @@ int afp_delete(AFPObj *obj, char *ibuf, size_t ibuflen _U_, char *rbuf _U_, size
         }
         else {
             rc = deletefile(vol, -1, upath, 1);
+
+            struct dir *cachedfile;
+            if (cachedfile = dircache_search_by_name(vol, dir, upath, strlen(upath))) {
+                dircache_remove(vol, dir, DIRCACHE | DIDNAME_INDEX | QUEUE_INDEX);
+                dir_free(cachedfile);
+            }
         }
     }
     if ( rc == AFP_OK ) {