From 1cc3c0f2fbc80b6382388e438ad29b17f261f593 Mon Sep 17 00:00:00 2001 From: P. J. McDermott Date: Fri, 30 Oct 2015 18:17:47 -0400 Subject: tools/shmin.sh: Close input file's FD --- diff --git a/tools/shmin.sh b/tools/shmin.sh index f84e31d..4c3c40b 100755 --- a/tools/shmin.sh +++ b/tools/shmin.sh @@ -188,7 +188,12 @@ minify() fgetc done - # We made it. Now write the output. + # We made it. Now close input file. + if ! exec 3<&-; then + die 'Cannot close file "%s"' "${input}" + fi + + # Write the output. if ! printf '%s' "${buffer}" >"${output}~"; then die 'Cannot write file "%s"' "${output}~" fi -- cgit v0.9.1