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:
parent
f8901862b2
commit
248fab742d
@ -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) {
|
||||
|
@ -123,7 +123,7 @@ static const char* fallback_chassis(void) {
|
||||
int r;
|
||||
char *type;
|
||||
unsigned t;
|
||||
Virtualization v;
|
||||
int v;
|
||||
|
||||
v = detect_virtualization(NULL);
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -26,7 +26,7 @@
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
Architecture a;
|
||||
Virtualization v;
|
||||
int v;
|
||||
const char *id = NULL;
|
||||
|
||||
v = detect_virtualization(&id);
|
||||
|
Loading…
Reference in New Issue
Block a user