Skip to content

Commit 31f4742

Browse files
committed
SDSIO-Server: Fix USB hotplug detection (prevent macOS libusb crash)
1 parent 22ed952 commit 31f4742

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

utilities/sdsio-server.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -890,6 +890,7 @@ async def start(self):
890890
dev_class = usb1.HOTPLUG_MATCH_ANY
891891
)
892892
except (AttributeError, usb1.USBError):
893+
# Hotplug not available; use polling monitor thread
893894
self.running = True
894895
self._monitor_thread = threading.Thread(
895896
target=self._monitor_loop,
@@ -915,6 +916,8 @@ async def start(self):
915916
x.submit()
916917
self.in_transfers.append(x)
917918

919+
# Mark server active in the normal path too (hotplug working)
920+
self.running = True
918921
printer.info(f"USB Server running.")
919922

920923
# start polling thread

0 commit comments

Comments
 (0)