blob: 7d38cff226f1c5c51ac849ae57e24888bad04079 [file] [log] [blame]
mukesh agrawal3ff527c2014-04-08 17:07:56 -07001// 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
9namespace shill {
10
11ScopedUmask::ScopedUmask(mode_t new_umask) {
12 saved_umask_ = umask(new_umask);
13}
14
15ScopedUmask::~ScopedUmask() {
16 umask(saved_umask_);
17}
18
19} // namespace shill