summaryrefslogtreecommitdiff
path: root/archbuild.in
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@parabola.nu>2017-03-25 12:34:38 -0400
committerJan Alexander Steffens (heftig) <jan.steffens@gmail.com>2017-04-05 22:03:00 +0200
commit997bc1dc0db12ee5791bfb74f07c91ce10ed7cfd (patch)
treece42333902e990055f4bde7750d32dc10f7b7a8f /archbuild.in
parentf73c1f172f93b734ec46e861ed1ba8fbb05e65cf (diff)
downloaddevtools-997bc1dc0db12ee5791bfb74f07c91ce10ed7cfd.tar.xz
lib/common.sh: add 'lock_close'; use it as appropriate.
`lock_close FD` is easier to remember than 'exec FD>&-`; and is especially easier if FD is a variable (though that isn't actually taken advantage of here). This uses Bash 4.1+ `exec {var}>&-`, rather than the clunkier `eval exec "$var>&-"` that was necessary in older versions of Bash. Thanks to Dave Reisner for pointing this new bit of syntax out to me the last time I submitted this (back in 2014, 4.1 had just come out).
Diffstat (limited to 'archbuild.in')
-rw-r--r--archbuild.in2
1 files changed, 1 insertions, 1 deletions
diff --git a/archbuild.in b/archbuild.in
index a78353c..4d1b351 100644
--- a/archbuild.in
+++ b/archbuild.in
@@ -55,7 +55,7 @@ if ${clean_first} || [[ ! -d "${chroots}/${repo}-${arch}" ]]; then
subvolume_delete_recursive "${copy}"
rm -rf --one-file-system "${copy}"
done
- exec 9>&-
+ lock_close 9
rm -rf --one-file-system "${chroots}/${repo}-${arch}"
mkdir -p "${chroots}/${repo}-${arch}"