From 4e46eacd643ec572ff29ec16b741ca17e381c2d0 Mon Sep 17 00:00:00 2001 From: Lars Karlitski Date: Sun, 25 Oct 2020 08:55:05 +0100 Subject: [PATCH] worker: handle error when closing osbuild's stdin This will only happen rarely, but it will be good to know it happened when it does. --- cmd/osbuild-worker/osbuild.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cmd/osbuild-worker/osbuild.go b/cmd/osbuild-worker/osbuild.go index 9059be49d..6c5a6c510 100644 --- a/cmd/osbuild-worker/osbuild.go +++ b/cmd/osbuild-worker/osbuild.go @@ -43,8 +43,11 @@ func RunOSBuild(manifest distro.Manifest, store, outputDirectory string, errorWr if err != nil { return nil, fmt.Errorf("error encoding osbuild pipeline: %v", err) } - // FIXME: handle or comment this possible error - _ = stdin.Close() + + err = stdin.Close() + if err != nil { + return nil, fmt.Errorf("error closing osbuild's stdin: %v", err) + } var result osbuild.Result err = json.NewDecoder(stdout).Decode(&result)