aboutsummaryrefslogtreecommitdiff
path: root/acl.c
diff options
context:
space:
mode:
authorBlue Swirl <blauwirbel@gmail.com>2009-09-12 07:36:22 +0000
committerBlue Swirl <blauwirbel@gmail.com>2009-09-12 07:36:22 +0000
commit72cf2d4f0e181d0d3a3122e04129c58a95da713e (patch)
tree4d13c505a692104406090e94dd654fd1e98ec34e /acl.c
parent620150dc9c1827cdddfa64a0fada7af5f7ee405b (diff)
downloadqemu-72cf2d4f0e181d0d3a3122e04129c58a95da713e.zip
qemu-72cf2d4f0e181d0d3a3122e04129c58a95da713e.tar.gz
qemu-72cf2d4f0e181d0d3a3122e04129c58a95da713e.tar.bz2
Fix sys-queue.h conflict for good
Problem: Our file sys-queue.h is a copy of the BSD file, but there are some additions and it's not entirely compatible. Because of that, there have been conflicts with system headers on BSD systems. Some hacks have been introduced in the commits 15cc9235840a22c289edbe064a9b3c19c5f49896, f40d753718c72693c5f520f0d9899f6e50395e94, 96555a96d724016e13190b28cffa3bc929ac60dc and 3990d09adf4463eca200ad964cc55643c33feb50 but the fixes were fragile. Solution: Avoid the conflict entirely by renaming the functions and the file. Revert the previous hacks. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Diffstat (limited to 'acl.c')
-rw-r--r--acl.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/acl.c b/acl.c
index 1a11a61..311dade 100644
--- a/acl.c
+++ b/acl.c
@@ -64,7 +64,7 @@ qemu_acl *qemu_acl_init(const char *aclname)
acl->defaultDeny = 1;
acl->nentries = 0;
- TAILQ_INIT(&acl->entries);
+ QTAILQ_INIT(&acl->entries);
acls = qemu_realloc(acls, sizeof(*acls) * (nacls +1));
acls[nacls] = acl;
@@ -78,7 +78,7 @@ int qemu_acl_party_is_allowed(qemu_acl *acl,
{
qemu_acl_entry *entry;
- TAILQ_FOREACH(entry, &acl->entries, next) {
+ QTAILQ_FOREACH(entry, &acl->entries, next) {
#ifdef CONFIG_FNMATCH
if (fnmatch(entry->match, party, 0) == 0)
return entry->deny ? 0 : 1;
@@ -102,8 +102,8 @@ void qemu_acl_reset(qemu_acl *acl)
* of "open access" while the user re-initializes the
* access control list */
acl->defaultDeny = 1;
- TAILQ_FOREACH(entry, &acl->entries, next) {
- TAILQ_REMOVE(&acl->entries, entry, next);
+ QTAILQ_FOREACH(entry, &acl->entries, next) {
+ QTAILQ_REMOVE(&acl->entries, entry, next);
free(entry->match);
free(entry);
}
@@ -121,7 +121,7 @@ int qemu_acl_append(qemu_acl *acl,
entry->match = qemu_strdup(match);
entry->deny = deny;
- TAILQ_INSERT_TAIL(&acl->entries, entry, next);
+ QTAILQ_INSERT_TAIL(&acl->entries, entry, next);
acl->nentries++;
return acl->nentries;
@@ -147,10 +147,10 @@ int qemu_acl_insert(qemu_acl *acl,
entry->match = qemu_strdup(match);
entry->deny = deny;
- TAILQ_FOREACH(tmp, &acl->entries, next) {
+ QTAILQ_FOREACH(tmp, &acl->entries, next) {
i++;
if (i == index) {
- TAILQ_INSERT_BEFORE(tmp, entry, next);
+ QTAILQ_INSERT_BEFORE(tmp, entry, next);
acl->nentries++;
break;
}
@@ -165,10 +165,10 @@ int qemu_acl_remove(qemu_acl *acl,
qemu_acl_entry *entry;
int i = 0;
- TAILQ_FOREACH(entry, &acl->entries, next) {
+ QTAILQ_FOREACH(entry, &acl->entries, next) {
i++;
if (strcmp(entry->match, match) == 0) {
- TAILQ_REMOVE(&acl->entries, entry, next);
+ QTAILQ_REMOVE(&acl->entries, entry, next);
return i;
}
}