X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fshared%2Fcapability.c;h=f34f6ba6f690c769004cabd7bfad4070f2664a94;hb=bf5332d2bf2a1acbba9daacf40570a4addbd3411;hp=9b743e86d0de468e66e4ed4145a042f596b57a12;hpb=f274ece0f76b5709408821e317e87aef76123db6;p=elogind.git diff --git a/src/shared/capability.c b/src/shared/capability.c index 9b743e86d..f34f6ba6f 100644 --- a/src/shared/capability.c +++ b/src/shared/capability.c @@ -34,6 +34,7 @@ #include "capability.h" #include "util.h" #include "log.h" +#include "fileio.h" int have_effective_cap(int value) { cap_t cap; @@ -54,8 +55,8 @@ int have_effective_cap(int value) { } unsigned long cap_last_cap(void) { - static __thread unsigned long saved; - static __thread bool valid = false; + static thread_local unsigned long saved; + static thread_local bool valid = false; unsigned long p; if (valid) @@ -203,7 +204,7 @@ static int drop_from_file(const char *fn, uint64_t drop) { if (asprintf(&p, "%u %u", lo, hi) < 0) return -ENOMEM; - r = write_one_line_file(fn, p); + r = write_string_file(fn, p); free(p); return r;