summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Hindoe Paaboel Andersen <phomes@gmail.com>2014-02-23 22:05:18 +0100
committerLennart Poettering <lennart@poettering.net>2014-02-24 13:26:44 +0100
commit248fab742d2b61557de93ac6e422986a8858bf52 (patch)
tree3d7fd35295b3bb7d5203733fdab221ae5e223686
parentf8901862b2b030921b3d5aba4157044ceab16451 (diff)
virt: make Virtualization an anonymous enum
This makes llvm happy when we assign an error code to the variable.
-rw-r--r--src/detect-virt/detect-virt.c2
-rw-r--r--src/hostname/hostnamed.c2
-rw-r--r--src/shared/condition-util.c3
-rw-r--r--src/shared/virt.c2
-rw-r--r--src/shared/virt.h6
-rw-r--r--src/test/test-architecture.c2
6 files changed, 8 insertions, 9 deletions
diff --git a/src/detect-virt/detect-virt.c b/src/detect-virt/detect-virt.c
index 2f8b0ebbbc..8cf8dcfabc 100644
--- a/src/detect-virt/detect-virt.c
+++ b/src/detect-virt/detect-virt.c
@@ -129,7 +129,7 @@ int main(int argc, char *argv[]) {
switch (arg_mode) {
case ANY_VIRTUALIZATION: {
- Virtualization v;
+ int v;
v = detect_virtualization(&id);
if (v < 0) {
diff --git a/src/hostname/hostnamed.c b/src/hostname/hostnamed.c
index e57891bf0d..0f2455b69c 100644
--- a/src/hostname/hostnamed.c
+++ b/src/hostname/hostnamed.c
@@ -123,7 +123,7 @@ static const char* fallback_chassis(void) {
int r;
char *type;
unsigned t;
- Virtualization v;
+ int v;
v = detect_virtualization(NULL);
diff --git a/src/shared/condition-util.c b/src/shared/condition-util.c
index 4aea3caf9d..9961cb47f0 100644
--- a/src/shared/condition-util.c
+++ b/src/shared/condition-util.c
@@ -121,8 +121,7 @@ bool condition_test_kernel_command_line(Condition *c) {
}
bool condition_test_virtualization(Condition *c) {
- int b;
- Virtualization v;
+ int b, v;
const char *id;
assert(c);
diff --git a/src/shared/virt.c b/src/shared/virt.c
index c79d35db4d..ec2ddcfe67 100644
--- a/src/shared/virt.c
+++ b/src/shared/virt.c
@@ -278,7 +278,7 @@ finish:
}
/* Returns a short identifier for the various VM/container implementations */
-Virtualization detect_virtualization(const char **id) {
+int detect_virtualization(const char **id) {
int r;
r = detect_container(id);
diff --git a/src/shared/virt.h b/src/shared/virt.h
index aa6ad35ba9..7194ab2bf7 100644
--- a/src/shared/virt.h
+++ b/src/shared/virt.h
@@ -24,12 +24,12 @@
int detect_vm(const char **id);
int detect_container(const char **id);
-typedef enum Virtualization {
+enum {
VIRTUALIZATION_NONE = 0,
VIRTUALIZATION_VM,
VIRTUALIZATION_CONTAINER,
_VIRTUALIZATION_MAX,
_VIRTUALIZATION_INVALID = -1
-} Virtualization;
+};
-Virtualization detect_virtualization(const char **id);
+int detect_virtualization(const char **id);
diff --git a/src/test/test-architecture.c b/src/test/test-architecture.c
index b586c0da5d..7e171c7bbc 100644
--- a/src/test/test-architecture.c
+++ b/src/test/test-architecture.c
@@ -26,7 +26,7 @@
int main(int argc, char *argv[]) {
Architecture a;
- Virtualization v;
+ int v;
const char *id = NULL;
v = detect_virtualization(&id);