From fa3d3268d7144f4d6b138a26677f1cd6827965d5 Mon Sep 17 00:00:00 2001 From: Clayton Craft Date: Sun, 5 Mar 2023 22:55:37 -0800 Subject: [PATCH] bootdeploy: catch any errors when closing kernel file copy fd --- internal/bootdeploy/bootdeploy.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/internal/bootdeploy/bootdeploy.go b/internal/bootdeploy/bootdeploy.go index 6613af7..b7d0e4d 100644 --- a/internal/bootdeploy/bootdeploy.go +++ b/internal/bootdeploy/bootdeploy.go @@ -76,7 +76,9 @@ func bootDeploy(workDir string, outDir string) error { if _, err = io.Copy(kernFileCopy, kernFd); err != nil { return err } - kernFileCopy.Close() + if err := kernFileCopy.Close(); err != nil { + return err + } // boot-deploy -i initramfs -k vmlinuz-postmarketos-rockchip -d /tmp/cpio -o /tmp/foo initramfs-extra cmd := exec.Command("boot-deploy",