1 // Copyright (c) 2013 The Chromium 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.
5 #ifndef BASE_SCOPED_CLEAR_ERRNO_H_
6 #define BASE_SCOPED_CLEAR_ERRNO_H_
10 #include "base/macros.h"
14 // Simple scoper that saves the current value of errno, resets it to 0, and on
15 // destruction puts the old value back.
16 class ScopedClearErrno {
18 ScopedClearErrno() : old_errno_(errno) {
29 DISALLOW_COPY_AND_ASSIGN(ScopedClearErrno);
34 #endif // BASE_SCOPED_CLEAR_ERRNO_H_