1
0
mirror of https://github.com/systemd/systemd.git synced 2024-12-23 21:35:11 +03:00

virt: make Virtualization an anonymous enum

This makes llvm happy when we assign an error code to the variable.
This commit is contained in:
Thomas Hindoe Paaboel Andersen 2014-02-23 22:05:18 +01:00 committed by Lennart Poettering
parent f8901862b2
commit 248fab742d
6 changed files with 8 additions and 9 deletions

View File

@ -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) {

View File

@ -123,7 +123,7 @@ static const char* fallback_chassis(void) {
int r;
char *type;
unsigned t;
Virtualization v;
int v;
v = detect_virtualization(NULL);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -26,7 +26,7 @@
int main(int argc, char *argv[]) {
Architecture a;
Virtualization v;
int v;
const char *id = NULL;
v = detect_virtualization(&id);