Update util.go

This commit is contained in:
Jeffrey Frey
2022-11-29 15:09:14 -05:00
committed by GitHub
parent 52b932081c
commit fd1f197468

View File

@@ -615,7 +615,8 @@ func FileGz(
outStr := string(out[:])
if err != nil && strings.HasSuffix(compressor, "gzip") && strings.Contains(outStr, "unrecognized option") {
var gzippedFile *os.File
var gzipStderr io.ReadCloser
/* Older version of gzip, try it another way: */
wwlog.Verbose("%s does not recognize the --keep flag, trying piped stdout", compressor)
@@ -633,7 +634,7 @@ func FileGz(
"--stdout",
file )
proc.Stdout = gzippedFile
gzipStderr, err := proc.StderrPipe()
gzipStderr, err = proc.StderrPipe()
if err != nil {
return errors.Wrapf(err, "Unable to open stderr pipe for compression program: %s", compressor)
}