From 686093669eb094eb585009b08175a70928849134 Mon Sep 17 00:00:00 2001 From: Zhaozhong Ni Date: Wed, 13 Jun 2018 10:13:23 -0700 Subject: sentry: do not treat all save errors as state file errors. PiperOrigin-RevId: 200410220 Change-Id: I6a8745e33be949e335719083501f18b24f6ba471 --- pkg/sentry/state/state.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'pkg') 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) -- cgit v1.2.3