Files
punktfunk/crates
enricobuehler df74dd5aee fix(windows/cursor): a device restart is NOT free — gate it again, and stop swallowing pnputil's reason
Two corrections, both from the box.

1. The previous commit made the between-session clean unconditional on the
   grounds that /restart-device is idempotent and costs 0.07 s. It is not free:
   after ~6 restarts in one afternoon .173 put the devnode into RESTART PENDING,
   and pnputil then refuses every further attempt -- 'a system restart is
   pending for this device to complete a previous operation' -- until an actual
   reboot. Restarting speculatively on every capture-mode connect would burn the
   only lever we have. So gate it on an outstanding declare again.

2. That failure was invisible. The script discarded pnputil's output and
   reported a bare exit code, so three separate runs looked like a wiring bug
   (the clean 'not firing') when in fact it ran every time and the restart
   failed. Keep the text, and surface a restart_pending field so the one
   failure that no retry can fix is named in the log.

Also corrects the previous commit's message: CURSOR_DECLARED was never the
problem. Both host processes run as SYSTEM and serve/handshake/capture share
one process, so the flag was set and read correctly all along.
2026-08-08 19:02:49 +02:00
..