X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fshared%2Fvirt.c;h=ec2ddcfe6722fac6f6335bccfc8bf478a8bb3968;hb=981e4cd325410384cdadd837f34c002699d2d750;hp=4e18638bc9e421ce842b8bbc2322bc7b1d5d81c3;hpb=bdb628eec6f5d5111251bd1a4d68516cef33d7d0;p=elogind.git diff --git a/src/shared/virt.c b/src/shared/virt.c index 4e18638bc..ec2ddcfe6 100644 --- a/src/shared/virt.c +++ b/src/shared/virt.c @@ -150,8 +150,8 @@ static int detect_vm_dmi(const char **_id) { /* Returns a short identifier for the various VM implementations */ int detect_vm(const char **id) { _cleanup_free_ char *hvtype = NULL, *cpuinfo_contents = NULL; - static __thread int cached_found = -1; - static __thread const char *cached_id = NULL; + static thread_local int cached_found = -1; + static thread_local const char *cached_id = NULL; const char *_id = NULL; int r; @@ -215,8 +215,8 @@ finish: int detect_container(const char **id) { - static __thread int cached_found = -1; - static __thread const char *cached_id = NULL; + static thread_local int cached_found = -1; + static thread_local const char *cached_id = NULL; _cleanup_free_ char *e = NULL; const char *_id = NULL; @@ -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);