summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Klug <john.klug@multitech.com>2021-09-03 18:42:16 -0500
committerJohn Klug <john.klug@multitech.com>2021-12-29 07:01:58 -0600
commitf2b4a3f754ce565e5b356ea2fdb5fa80feb04e51 (patch)
tree65eeeb9882d61f6309f1ec838ecd020bd670efdb
parent33f074318e832bd61cb5b70d4700c4bd1fb51219 (diff)
downloadmeta-mlinux-f2b4a3f754ce565e5b356ea2fdb5fa80feb04e51.tar.gz
meta-mlinux-f2b4a3f754ce565e5b356ea2fdb5fa80feb04e51.tar.bz2
meta-mlinux-f2b4a3f754ce565e5b356ea2fdb5fa80feb04e51.zip
Use exit and deregister with mts-io when done
-rwxr-xr-xrecipes-connectivity/ppp/files/wait_for_reset28
1 files changed, 14 insertions, 14 deletions
diff --git a/recipes-connectivity/ppp/files/wait_for_reset b/recipes-connectivity/ppp/files/wait_for_reset
index 7e9da95..e77df77 100755
--- a/recipes-connectivity/ppp/files/wait_for_reset
+++ b/recipes-connectivity/ppp/files/wait_for_reset
@@ -13,7 +13,7 @@ TERM=15
function sleep_reset
{
# Wait for parent to enter wait.
- trap "kill $!;kill $BASHPID" $TERM
+ trap "exit 0" $TERM
while [[ $(ps -h -o wchan -p $PPID) != do_wait ]] ; do usleep 100 ; done
${LOG} Register for SIGUSR2 when radio-reset complete
echo "$$" "$USR2" >/sys/devices/platform/mts-io/radio-reset-monitor
@@ -29,17 +29,17 @@ function sleep_reset
# Wait for radio-reset to complete
function wait_for_reset
{
- # Wait for radio reset/modem discovery
- trap ":" $USR2
- in_reset=$(cat /sys/devices/platform/mts-io/radio-udev-discovery)
- if ((in_reset == 0)) ; then
- sleep_reset &
- wait $!
- # pgrep is needed to find the sleep process
- echo "pgrep -P: $(pgrep -P $!)"
- pgrep -P $! | xargs kill
- ${LOG} "radio-reset is complete"
-
- fi
- trap "" $USR2
+ # Wait for radio reset/modem discovery
+ trap ":" $USR2
+ in_reset=$(cat /sys/devices/platform/mts-io/radio-udev-discovery)
+ if ((in_reset == 0)) ; then
+ sleep_reset &
+ wait $!
+ # pgrep is needed to find the sleep process
+ echo "pgrep -P: $(pgrep -P $!)"
+ pgrep -P $! | xargs kill
+ ${LOG} "radio-reset is complete"
+ fi
+ echo "$$" "0" >/sys/devices/platform/mts-io/radio-reset-monitor
+ trap "" $USR2
}