Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Fix the build: don't use 'access' as a variable name because that clashes with access() which ticks off gcc. Add err.h to rquery.c because without it use of warnx() ticks off clang...
Matthew Seaman committed 13 years ago
commit 73d08da9ecc4b528e136a4b7869fde3c4c2e6183
parent 6c1fc73
2 files changed +6 -6
modified libpkg/pkgdb.c
@@ -758,7 +758,6 @@ static int
database_access(unsigned mode, const char* dbdir, const char *dbname)
{
	char		 dbpath[MAXPATHLEN + 1];
-
	int		 access;
	int		 retval;
	bool		 database_exists;
	bool		 install_as_user;
@@ -783,20 +782,20 @@ database_access(unsigned mode, const char* dbdir, const char *dbname)

	switch(mode & (PKGDB_MODE_READ|PKGDB_MODE_WRITE)) {
	case 0:		/* Existence test */
-
		access = eaccess(dbpath, F_OK);
+
		retval = eaccess(dbpath, F_OK);
		break;
	case PKGDB_MODE_READ:
-
		access = eaccess(dbpath, R_OK);
+
		retval = eaccess(dbpath, R_OK);
		break;
	case PKGDB_MODE_WRITE:
-
		access = eaccess(dbpath, W_OK);
+
		retval = eaccess(dbpath, W_OK);
		break;
	case PKGDB_MODE_READ|PKGDB_MODE_WRITE:
-
		access = eaccess(dbpath, R_OK|W_OK);
+
		retval = eaccess(dbpath, R_OK|W_OK);
		break;
	}

-
	if (access != 0) {
+
	if (retval != 0) {
		if (errno == ENOENT)
			return (EPKG_ENODB);
		else if (errno == EACCES)
modified pkg/rquery.c
@@ -30,6 +30,7 @@
#include <sys/sbuf.h>

#include <ctype.h>
+
#include <err.h>
#include <inttypes.h>
#include <libutil.h>
#include <pkg.h>