mukesh agrawal | 3ff527c | 2014-04-08 17:07:56 -0700 | [diff] [blame] | 1 | // Copyright (c) 2014 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 "shill/scoped_umask.h" | ||||
6 | |||||
7 | #include <sys/stat.h> | ||||
8 | |||||
9 | namespace shill { | ||||
10 | |||||
11 | ScopedUmask::ScopedUmask(mode_t new_umask) { | ||||
12 | saved_umask_ = umask(new_umask); | ||||
13 | } | ||||
14 | |||||
15 | ScopedUmask::~ScopedUmask() { | ||||
16 | umask(saved_umask_); | ||||
17 | } | ||||
18 | |||||
19 | } // namespace shill |