We just unlinked the file, so we know we won't be able to rmdir() the
same thing. Give a path one level higher to
namei_RemoveDataDirectories, so we start rmdir()ing at the parent dir.
Reviewed-on: http://gerrit.openafs.org/5833
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit
b41e30a55c8aeb6d7f42d74f9eb090232032057f)
Change-Id: Ibd14490e2d85bd78522472203ad57120237bff22
Reviewed-on: http://gerrit.openafs.org/6079
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
/* Try to remove directory. If it fails, that's ok.
* Salvage will clean up.
*/
+ char *slash = strrchr(name.n_path, OS_DIRSEPC);
+ if (slash) {
+ /* avoid an rmdir() on the file we just unlinked */
+ *slash = '\0';
+ }
(void)namei_RemoveDataDirectories(&name);
}
}