summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/sentry')
-rw-r--r--pkg/sentry/state/state.go5
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)