isobusfs: treat interactive exit as control flow, not error

The cmd_exit() function used -EINTR to signal a clean exit from the
interactive mode. This is semantically incorrect because EINTR is an
errno value meant for system call interruptions, not application-level
control flow.

Stop using -EINTR for cmd_exit(). Introduce ISOBUSFS_CLI_RET_EXIT (a
positive return code) to distinguish control flow from actual errors.
Map this to exit code 0 in main(), keeping negative errno values for
real errors. This makes the exit path explicit and prevents confusion
with actual interrupted system calls.

Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
This commit is contained in:
Oleksij Rempel
2026-10-14 10:21:55 +00:00
committed by Oliver Hartkopp
parent 64280dc9c3
commit a63fd488b2
3 changed files with 9 additions and 2 deletions
+3
View File
@@ -13,6 +13,9 @@
#define ISOBUSFS_CLI_MAX_EPOLL_EVENTS 10
#define ISOBUSFS_CLI_DEFAULT_WAIT_TIMEOUT_MS 1000 /* ms */
/* internal return codes, not errno values */
#define ISOBUSFS_CLI_RET_EXIT 1
enum isobusfs_cli_state {
ISOBUSFS_CLI_STATE_CONNECTING,
ISOBUSFS_CLI_STATE_IDLE,