aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexandru Ardelean <ardeleanalex@gmail.com>2018-02-15 15:15:58 +0100
committerJohn Crispin <john@phrozen.org>2018-02-18 09:34:32 +0100
commit0393009ec84e0f22d854e8e11e630d393d44efe9 (patch)
treee0093f12b526f5baebf9910ef91208f358aee77c
parent31ae7381b8db6ba58b1943b26c4a23b04928f363 (diff)
downloadupstream-0393009ec84e0f22d854e8e11e630d393d44efe9.tar.gz
upstream-0393009ec84e0f22d854e8e11e630d393d44efe9.tar.bz2
upstream-0393009ec84e0f22d854e8e11e630d393d44efe9.zip
net: uqmi: fix blocking in endless loops when unplugging device
If you unplug a QMI device, the /dev/cdc-wdmX device disappears but uqmi will continue to poll it endlessly. Then, when you plug it back, you have 2 uqmi processes, and that's bad, because 2 processes talking QMI to the same device [and the same time] doesn't seem to work well. Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
-rwxr-xr-xpackage/network/utils/uqmi/files/lib/netifd/proto/qmi.sh2
1 files changed, 2 insertions, 0 deletions
diff --git a/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh b/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh
index 6f11933a9e..9c953ea697 100755
--- a/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh
+++ b/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh
@@ -65,6 +65,7 @@ proto_qmi_setup() {
[ -n "$delay" ] && sleep "$delay"
while uqmi -s -d "$device" --get-pin-status | grep '"UIM uninitialized"' > /dev/null; do
+ [ -e "$device" ] || return 1
sleep 1;
done
@@ -102,6 +103,7 @@ proto_qmi_setup() {
echo "Waiting for network registration"
while uqmi -s -d "$device" --get-serving-system | grep '"searching"' > /dev/null; do
+ [ -e "$device" ] || return 1
sleep 5;
done