aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorartoo <artoo@artixlinux.org>2019-10-05 16:32:21 +0200
committerWilliam Hubbs <w.d.hubbs@gmail.com>2020-01-11 13:32:38 -0600
commiteb610859519292c6164c4ba601d22e642c306beb (patch)
tree2e6eb401927ccbfc7e9e417382cbf67596045865
parent039845b742e40752b05ef9393d5a6959d55fe0b6 (diff)
binfmt: ensure a file is ungegistered before registering
This fixes #328
-rw-r--r--sh/binfmt.sh.in3
1 files changed, 3 insertions, 0 deletions
diff --git a/sh/binfmt.sh.in b/sh/binfmt.sh.in
index ca4a8833..11a57211 100644
--- a/sh/binfmt.sh.in
+++ b/sh/binfmt.sh.in
@@ -29,6 +29,9 @@ apply_file() {
\;*) continue ;;
esac
+ local reg=${line#*:}
+ [ -e /proc/sys/fs/binfmt_misc/${reg%%:*} ] && echo -1 > /proc/sys/fs/binfmt_misc/${reg%%:*}
+
echo "${line}" > /proc/sys/fs/binfmt_misc/register
rc=$?
if [ $rc -ne 0 ]; then