diff options
author | gVisor bot <gvisor-bot@google.com> | 2019-08-26 14:04:24 -0700 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2019-08-26 14:07:17 -0700 |
commit | baf4d8aaca520255d52627779ada2be56be7f861 (patch) | |
tree | 77020e9e6ae843756dbee6151e2b8c54079f3c8d /test/util/save_util.cc | |
parent | 7206202bb9439499a084a90dd885ef77f51186aa (diff) |
Internal change.
PiperOrigin-RevId: 265535438
Diffstat (limited to 'test/util/save_util.cc')
-rw-r--r-- | test/util/save_util.cc | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/test/util/save_util.cc b/test/util/save_util.cc index 05f52b80d..384d626f0 100644 --- a/test/util/save_util.cc +++ b/test/util/save_util.cc @@ -16,8 +16,8 @@ #include <stddef.h> #include <stdlib.h> -#include <sys/syscall.h> #include <unistd.h> + #include <atomic> #include <cerrno> @@ -61,13 +61,11 @@ void DisableSave::reset() { } } -void MaybeSave() { - if (CooperativeSaveEnabled() && !save_disable.load()) { - int orig_errno = errno; - syscall(SYS_create_module, nullptr, 0); - errno = orig_errno; - } +namespace internal { +bool ShouldSave() { + return CooperativeSaveEnabled() && (save_disable.load() == 0); } +} // namespace internal } // namespace testing } // namespace gvisor |