diff options
author | Luke Shumaker <lukeshu@parabola.nu> | 2017-02-06 02:55:30 -0500 |
---|---|---|
committer | Luke Shumaker <lukeshu@lukeshu.com> | 2017-03-25 12:09:33 -0400 |
commit | d149cc9baf581e234cdf357ce37a604bf73115ea (patch) | |
tree | ce42333902e990055f4bde7750d32dc10f7b7a8f /makechrootpkg.in | |
parent | f73c1f172f93b734ec46e861ed1ba8fbb05e65cf (diff) | |
download | devtools32-d149cc9baf581e234cdf357ce37a604bf73115ea.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 'makechrootpkg.in')
-rw-r--r-- | makechrootpkg.in | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/makechrootpkg.in b/makechrootpkg.in index dc598f7..ad99334 100644 --- a/makechrootpkg.in +++ b/makechrootpkg.in @@ -108,7 +108,7 @@ create_chroot() { stat_done # Drop the read lock again - exec 8>&- + lock_close 8 fi # Update mtime |