From b464e52b99e0a44d8a0fae616b193bd2250e209b Mon Sep 17 00:00:00 2001 From: Steve Bennett Date: Wed, 19 Oct 2016 07:51:46 +1000 Subject: examples/tip.tcl: Lock the device Prevent multiple access to a serial port by using locking. This is probably compatible with most serial port locking on Linux. Perhaps on macosx. Signed-off-by: Steve Bennett --- examples/tip.tcl | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'examples') diff --git a/examples/tip.tcl b/examples/tip.tcl index 2770dcb..3de25e3 100755 --- a/examples/tip.tcl +++ b/examples/tip.tcl @@ -82,6 +82,11 @@ try { return 1 } +if {[$f lock] == 0} { + puts "Device is in use: $device" + return 1 +} + try { $f tty {*}$settings } on error msg { -- cgit v1.1