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 | #ifndef SHILL_SCOPED_UMASK_H_ |
| 6 | #define SHILL_SCOPED_UMASK_H_ |
| 7 | |
| 8 | #include <sys/types.h> |
| 9 | |
| 10 | #include <base/basictypes.h> |
| 11 | |
| 12 | namespace shill { |
| 13 | |
| 14 | class ScopedUmask { |
| 15 | public: |
| 16 | explicit ScopedUmask(mode_t new_umask); |
| 17 | ~ScopedUmask(); |
| 18 | |
| 19 | private: |
| 20 | mode_t saved_umask_; |
| 21 | |
| 22 | DISALLOW_COPY_AND_ASSIGN(ScopedUmask); |
| 23 | }; |
| 24 | |
| 25 | } // namespace shill |
| 26 | |
| 27 | #endif // SHILL_SCOPED_UMASK_H_ |