Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
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 6d27740
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 */