]>
git.ipfire.org Git - thirdparty/systemd.git/blob - src/basic/umask-util.h
1 /* SPDX-License-Identifier: LGPL-2.1+ */
5 This file is part of systemd.
7 Copyright 2010 Lennart Poettering
12 #include <sys/types.h>
16 static inline void umaskp(mode_t
*u
) {
20 #define _cleanup_umask_ _cleanup_(umaskp)
22 struct _umask_struct_
{
27 static inline void _reset_umask_(struct _umask_struct_
*s
) {
31 #define RUN_WITH_UMASK(mask) \
32 for (_cleanup_(_reset_umask_) struct _umask_struct_ _saved_umask_ = { umask(mask), false }; \
33 !_saved_umask_.quit ; \
34 _saved_umask_.quit = true)