aboutsummaryrefslogtreecommitdiff
path: root/vendor/github.com/Microsoft/hcsshim/computestorage/helpers.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/Microsoft/hcsshim/computestorage/helpers.go')
-rw-r--r--vendor/github.com/Microsoft/hcsshim/computestorage/helpers.go12
1 files changed, 4 insertions, 8 deletions
diff --git a/vendor/github.com/Microsoft/hcsshim/computestorage/helpers.go b/vendor/github.com/Microsoft/hcsshim/computestorage/helpers.go
index d31efd660..87fee452c 100644
--- a/vendor/github.com/Microsoft/hcsshim/computestorage/helpers.go
+++ b/vendor/github.com/Microsoft/hcsshim/computestorage/helpers.go
@@ -70,11 +70,9 @@ func SetupContainerBaseLayer(ctx context.Context, layerPath, baseVhdPath, diffVh
defer func() {
if err != nil {
- syscall.CloseHandle(handle)
+ _ = syscall.CloseHandle(handle)
os.RemoveAll(baseVhdPath)
- if os.Stat(diffVhdPath); err == nil {
- os.RemoveAll(diffVhdPath)
- }
+ os.RemoveAll(diffVhdPath)
}
}()
@@ -148,11 +146,9 @@ func SetupUtilityVMBaseLayer(ctx context.Context, uvmPath, baseVhdPath, diffVhdP
defer func() {
if err != nil {
- syscall.CloseHandle(handle)
+ _ = syscall.CloseHandle(handle)
os.RemoveAll(baseVhdPath)
- if os.Stat(diffVhdPath); err == nil {
- os.RemoveAll(diffVhdPath)
- }
+ os.RemoveAll(diffVhdPath)
}
}()