stdenv, swift: Use local fd in is* bash functions for hygiene

This commit is contained in:
John Ericson
2017-07-07 11:40:07 -04:00
committed by John Ericson
parent a14cf06182
commit e57a220f81
2 changed files with 4 additions and 1 deletions
+2
View File
@@ -194,6 +194,7 @@ _addRpathPrefix() {
# Return success if the specified file is an ELF object.
isELF() {
local fn="$1"
local fd
local magic
exec {fd}< "$fn"
read -n 4 -u $fd magic
@@ -205,6 +206,7 @@ isELF() {
# "#!").
isScript() {
local fn="$1"
local fd
local magic
if ! [ -x /bin/sh ]; then return 0; fi
exec {fd}< "$fn"