1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
/* * Copyright (c) 2022, Andreas Kling <kling@serenityos.org> * * SPDX-License-Identifier: BSD-2-Clause */ #include <sys/stat.h> #include <sys/types.h> #pragma once namespace Core { class UmaskScope { public: explicit UmaskScope(mode_t mask) { m_old_mask = umask(mask); } ~UmaskScope() { umask(m_old_mask); } private: mode_t m_old_mask {}; }; }