voids do not collapse until all processes leave

This commit is contained in:
Martinez 2017-10-01 01:19:07 +02:00
parent 6931f58a73
commit 6888571eea

View file

@ -132,6 +132,17 @@ function mkvoid () {
pushd "${__MKVOID_PATH}" > /dev/null || die "pushd"
OVER_PROMPT_VOIDS="$OVER_PROMPT_VOIDS:$__MKVOID_NAME" zsh
popd > /dev/null
while true; do
fuser -s "${__MKVOID_PATH}"
if [[ $? == 1 ]]; then
break
else
echo -n ">>> Waiting for other processes to abandon this void.\r"
fi
sleep 5
done
rm -f "${__MKVOID_PATH}" || die "rm link"
rm -rf "${__MKVOID_ID}" || die "rm void"
}