Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Try to fix on osx
Baptiste Daroussin committed 11 years ago
commit 95324c3b5e90230fdca1b11f24348ebc4698a205
parent 40de1c0
1 file changed +6 -4
modified libpkg/pkg_delete.c
@@ -168,6 +168,9 @@ rmdir_p(struct pkgdb *db, struct pkg *pkg, char *dir, const char *prefix_r)
	char fullpath[MAXPATHLEN];
	size_t len;
	struct stat st;
+
#if defined(HAVE_CHFLAGS) && !defined(HAVE_CHFLAGSAT)
+
	int fd;
+
#endif

	len = snprintf(fullpath, sizeof(fullpath), "/%s", dir);
	while (fullpath[len -1] == '/') {
@@ -199,8 +202,6 @@ rmdir_p(struct pkgdb *db, struct pkg *pkg, char *dir, const char *prefix_r)
			    st.st_flags & ~NOCHANGESFLAGS,
			    AT_SYMLINK_NOFOLLOW);
#else
-
			int fd;
-

			fd = openat(pkg->rootfd, dir, O_NOFOLLOW);
			if (fd > 0) {
				fchflags(fd, st.st_flags & ~NOCHANGESFLAGS);
@@ -256,6 +257,9 @@ pkg_delete_file(struct pkg *pkg, struct pkg_file *file, unsigned force)
	struct stat st;
	size_t len;
	char sha256[SHA256_DIGEST_LENGTH * 2 + 1];
+
#if defined(HAVE_CHFLAGS) && !defined(HAVE_CHFLAGSAT)
+
	int fd;
+
#endif

	pkg_open_root_fd(pkg);

@@ -301,8 +305,6 @@ pkg_delete_file(struct pkg *pkg, struct pkg_file *file, unsigned force)
			    st.st_flags & ~NOCHANGESFLAGS,
			    AT_SYMLINK_NOFOLLOW);
#else
-
			int fd;
-

			fd = openat(pkg->rootfd, path, O_NOFOLLOW);
			if (fd > 0) {
				fchflags(fd, st.st_flags & ~NOCHANGESFLAGS);