mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-09 22:08:56 +08:00
fix(px4_daemon): annotate intentional empty catch in client cleanup
bugprone-empty-catch flagged the std::system_error swallow around the detached stdin-relay thread. Spell out why the catch body is empty and add an explicit (void)0 statement so the intent is visible to both the linter and future readers: stdin forwarding is best-effort, and a failed thread spawn must not abort the client. Signed-off-by: Nuno Marques <n.marques21@hotmail.com>
This commit is contained in:
@@ -225,7 +225,10 @@ Client::process_args(const int argc, const char **argv)
|
||||
std::thread(stdin_forward_loop, _fd).detach();
|
||||
|
||||
} catch (const std::system_error &) {
|
||||
// Non-fatal: stdin relay was best-effort.
|
||||
// intentionally swallowed: stdin relay is best-effort. If the OS cannot
|
||||
// spawn the helper thread, interactive commands lose keystroke
|
||||
// forwarding but the command itself still runs to completion.
|
||||
(void)0;
|
||||
}
|
||||
|
||||
return _listen();
|
||||
|
||||
Reference in New Issue
Block a user