diff options
author | Lennart Poettering <lennart@poettering.net> | 2015-10-26 23:20:41 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2015-10-27 13:25:56 +0100 |
commit | affb60b1ef0cb48388d23360c6f3b043c50f6b8c (patch) | |
tree | a2fd6419b97665e6b4705fa6192a55bea54b67e9 /src/basic/util.h | |
parent | 8752c5752f3b9023f9ce96a55d70c6e5fc31118f (diff) |
util-lib: split out umask-related code to umask-util.h
Diffstat (limited to 'src/basic/util.h')
-rw-r--r-- | src/basic/util.h | 19 |
1 files changed, 0 insertions, 19 deletions
diff --git a/src/basic/util.h b/src/basic/util.h index 680317909d..e356f59cd5 100644 --- a/src/basic/util.h +++ b/src/basic/util.h @@ -152,12 +152,7 @@ static inline void freep(void *p) { free(*(void**) p); } -static inline void umaskp(mode_t *u) { - umask(*u); -} - #define _cleanup_free_ _cleanup_(freep) -#define _cleanup_umask_ _cleanup_(umaskp) #define _cleanup_globfree_ _cleanup_(globfree) _malloc_ _alloc_(1, 2) static inline void *malloc_multiply(size_t a, size_t b) { @@ -222,20 +217,6 @@ static inline int negative_errno(void) { return -errno; } -struct _umask_struct_ { - mode_t mask; - bool quit; -}; - -static inline void _reset_umask_(struct _umask_struct_ *s) { - umask(s->mask); -}; - -#define RUN_WITH_UMASK(mask) \ - for (_cleanup_(_reset_umask_) struct _umask_struct_ _saved_umask_ = { umask(mask), false }; \ - !_saved_umask_.quit ; \ - _saved_umask_.quit = true) - static inline unsigned u64log2(uint64_t n) { #if __SIZEOF_LONG_LONG__ == 8 return (n > 1) ? (unsigned) __builtin_clzll(n) ^ 63U : 0; |