Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--archbuild.in2
-rw-r--r--lib/common.sh8
-rw-r--r--makechrootpkg.in2
3 files changed, 10 insertions, 2 deletions
diff --git a/archbuild.in b/archbuild.in
index 9c5d706..c1917c3 100644
--- a/archbuild.in
+++ b/archbuild.in
@@ -58,7 +58,7 @@ if ${clean_first} || [[ ! -d "${chroots}/${repo}-${arch}" ]]; then
fi
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}"
diff --git a/lib/common.sh b/lib/common.sh
index f6aea93..91a55dc 100644
--- a/lib/common.sh
+++ b/lib/common.sh
@@ -159,6 +159,14 @@ slock() {
}
##
+# usage : lock_close( $fd )
+##
+lock_close() {
+ local fd=$1
+ exec {fd}>&-
+}
+
+##
# usage: pkgver_equal( $pkgver1, $pkgver2 )
##
pkgver_equal() {
diff --git a/makechrootpkg.in b/makechrootpkg.in
index 284d444..9970145 100644
--- a/makechrootpkg.in
+++ b/makechrootpkg.in
@@ -103,7 +103,7 @@ create_chroot() {
stat_done
# Drop the read lock again
- exec 8>&-
+ lock_close 8
fi
# Update mtime