lantiq: Synchronize access to the DSL command pipe
authorblogic <blogic@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Mon, 19 Oct 2015 10:08:56 +0000 (10:08 +0000)
committerblogic <blogic@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Mon, 19 Oct 2015 10:08:56 +0000 (10:08 +0000)
Whenever two processes were executing different commands at the same
time then one of the commands sometimes got the response of the other
command.

Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@47213 3c298f89-4303-0410-b956-a3cf2f4a3e73

target/linux/lantiq/base-files/lib/functions/lantiq_dsl.sh

index dbeb344..22e65cb 100755 (executable)
@@ -12,8 +12,10 @@ fi
 #
 dsl_cmd() {
        killall -0 ${XDSL_CTRL} && (
+               lock /var/lock/dsl_pipe
                echo "$@" > /tmp/pipe/dsl_cpe0_cmd
                cat /tmp/pipe/dsl_cpe0_ack
+               lock -u /var/lock/dsl_pipe
        )
 }
 dsl_val() {