goto exit;
}
- if (dir_modify(vol,
- sdir,
- curdir->d_did,
- 0,
- newname,
- upath,
- S_ISDIR(st->st_mode) ? curdir->d_fullpath : NULL) != 0) {
- LOG(log_error, logtype_afpd, "moveandrename: dir_modify error: %s -> %s",
- p, upath);
- return AFPERR_MISC;
+ /* Remove it from the cache */
+ struct dir *cacheddir = dircache_search_by_did(vol, id);
+ if (cacheddir) {
+ LOG(log_warning, logtype_afpd,"Still cached: \"%s/%s\"", getcwdpath(), upath);
+ (void)dir_remove(vol, cacheddir);
}
/* fix up the catalog entry */
rc = deletefile(vol, -1, upath, 1);
struct dir *cachedfile;
- if ((cachedfile = dircache_search_by_name(vol, dir, upath, strlen(upath)))) {
+ if ((cachedfile = dircache_search_by_name(vol, dir, upath, strlen(upath), s_path->st.st_ctime))) {
dircache_remove(vol, cachedfile, DIRCACHE | DIDNAME_INDEX | QUEUE_INDEX);
dir_free(cachedfile);
}