]> sigrok.org Git - libsigrok.git/commit
std: avoid doube close
authorWolfram Sang <redacted>
Sat, 11 Apr 2020 20:45:00 +0000 (22:45 +0200)
committerUwe Hermann <redacted>
Wed, 24 Jun 2020 21:20:41 +0000 (23:20 +0200)
commit9b093606545ec3963a03a3cfac61954c62e93e10
tree95231500cbb1d6cff8f5950d75a5ba6febcb5832
parent8b58a519e4d9e972f2cfc2f05ab2fc2c9f3fd591
std: avoid doube close

I want to fix this double-close issue I see with my OLS:

First close at the end of a 'scan':

sr: [00:00.045171] openbench-logic-sniffer: Got metadata key 0x00, metadata ends.
sr: [00:00.045178] openbench-logic-sniffer: Disabling demux mode.
sr: [00:00.045186] serial: Closing serial port /dev/ttyACM0.

Second one as part of hwdriver cleanup:

sr: [00:00.046088] hwdriver: Cleaning up all drivers.
sr: [00:00.046108] serial: Closing serial port /dev/ttyACM0.
sr: [00:00.046116] serial-libsp: Cannot close unopened serial port /dev/ttyACM0.

So, before closing a second time, check if the device is not idle.

I am optimistic this could fix bugs #1151 and #1275, too.

Signed-off-by: Wolfram Sang <redacted>
src/std.c