diff options
author | Zhaozhong Ni <nzz@google.com> | 2018-06-13 10:13:23 -0700 |
---|---|---|
committer | Shentubot <shentubot@google.com> | 2018-06-13 10:14:15 -0700 |
commit | 686093669eb094eb585009b08175a70928849134 (patch) | |
tree | e42924bd5fcf6d6e7b0926eff96b32d9575ad738 /pkg/sentry/state/state.go | |
parent | 55b905845650efc9a0a23066f8ffd25ce2565bbc (diff) |
sentry: do not treat all save errors as state file errors.
PiperOrigin-RevId: 200410220
Change-Id: I6a8745e33be949e335719083501f18b24f6ba471
Diffstat (limited to 'pkg/sentry/state/state.go')
-rw-r--r-- | pkg/sentry/state/state.go | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/pkg/sentry/state/state.go b/pkg/sentry/state/state.go index 393289926..43e88a713 100644 --- a/pkg/sentry/state/state.go +++ b/pkg/sentry/state/state.go @@ -78,10 +78,7 @@ func (opts SaveOpts) Save(k *kernel.Kernel, w *watchdog.Watchdog) error { // Save the kernel. err = k.SaveTo(wc) if closeErr := wc.Close(); err == nil && closeErr != nil { - err = closeErr - } - if err != nil { - err = ErrStateFile{err} + err = ErrStateFile{closeErr} } } opts.Callback(err) |