chiark / gitweb /
Use enums to make it obvious what boolean params mean
[elogind.git] / src / shared / capability.c
index cad718d749959e839616ce05ea8ec2fe2763f629..72c671cf840a5e159609e8ff7ae6e4eabd294aae 100644 (file)
@@ -55,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)
@@ -137,7 +137,7 @@ int capability_bounding_set_drop(uint64_t drop, bool right_now) {
                                 r = -errno;
                                 goto finish;
                         }
-                        v = i;
+                        v = (cap_value_t) i;
 
                         /* Also drop it from the inheritable set, so
                          * that anything we exec() loses the
@@ -204,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;