1 // Copyright 2019 The Chromium OS Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #include "brillo/scoped_umask.h" 6 7 #include <sys/stat.h> 8 9 namespace brillo { 10 ScopedUmask(mode_t new_umask)11ScopedUmask::ScopedUmask(mode_t new_umask) { 12 saved_umask_ = umask(new_umask); 13 } 14 ~ScopedUmask()15ScopedUmask::~ScopedUmask() { 16 umask(saved_umask_); 17 } 18 19 } // namespace brillo 20