catch_errno_guard.cpp 385 B

123456789101112131415
  1. /*
  2. * Created by Martin on 06/03/2017.
  3. *
  4. * Distributed under the Boost Software License, Version 1.0. (See accompanying
  5. * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  6. */
  7. #include "catch_errno_guard.h"
  8. #include <cerrno>
  9. namespace Catch {
  10. ErrnoGuard::ErrnoGuard():m_oldErrno(errno){}
  11. ErrnoGuard::~ErrnoGuard() { errno = m_oldErrno; }
  12. }