Radish alpha
H
HardenedBSD Package Manager
Radicle
Git (anonymous pull)
Log in to clone via SSH
As soon as we were not able to remove on directory stop trying to remove parents
Baptiste Daroussin committed 11 years ago
commit 4493c7e29ecc9e259f226d4263dc76d3d2392a6b
parent 6d277409fd56a041a7e4c3faf44f4053880cc961
1 file changed +4 -3
modified libpkg/pkg_delete.c
@@ -182,9 +182,10 @@ rmdir_p(struct pkgdb *db, struct pkg *pkg, char *dir, const char *prefix_r)
		return;

	pkg_debug(1, "removing directory %s", fullpath);
-
	if (unlinkat(pkg->rootfd, dir, AT_REMOVEDIR) == -1 &&
-
	    errno != ENOTEMPTY && errno != EBUSY) {
-
		pkg_emit_errno("unlinkat", dir);
+
	if (unlinkat(pkg->rootfd, dir, AT_REMOVEDIR) == -1) {
+
		if (errno != ENOTEMPTY && errno != EBUSY)
+
			pkg_emit_errno("unlinkat", dir);
+
		return;
	}

	/* No recursivity for packages out of the prefix */