summaryrefslogtreecommitdiff
path: root/src/shared/virt.c
diff options
context:
space:
mode:
authorShawn Landden <shawn@churchofgit.com>2013-12-15 16:24:14 -0800
committerLennart Poettering <lennart@poettering.net>2013-12-17 21:45:43 +0100
commitec202eae8e84a4c99f054f771cb832046cb8769f (patch)
tree3342ddcf1d386c7f613b60e3d72477580eb7ba06 /src/shared/virt.c
parent06db8540cdfc8259423ed90e7352dbc1d71eccd9 (diff)
__thread --> thread_local for C11 compat
Also make thread_local available w/o including <threads.h>. (as the latter hasn't been implemented, but this part is trivial)
Diffstat (limited to 'src/shared/virt.c')
-rw-r--r--src/shared/virt.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/shared/virt.c b/src/shared/virt.c
index 4e18638bc9..c79d35db4d 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;