From 42611a787d5974606b7230aeacd38a339eca904f Mon Sep 17 00:00:00 2001 From: Peter Oberparleiter Date: Fri, 30 Jun 2023 16:46:05 +0200 Subject: [PATCH] zdev: use consistent exit code for nonexistent device nodes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit zdev's --by-node option returns exit code 15 (EXIT_RUNTIME_ERROR) when the specified device node cannot be found. This is inconsistent with other selection options --by-path and --by-interface which both return the more appropriate exit code 3 (EXIT_DEVICE_NOT_FOUND). Fix this by changing --by-node to also return exit code 3 in case the specified device node does not exist. Reviewed-by: Vineeth Vijayan Signed-off-by: Peter Oberparleiter Signed-off-by: Jan Höppner --- zdev/src/select.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zdev/src/select.c b/zdev/src/select.c index adb7bfb5..cdb2914f 100644 --- a/zdev/src/select.c +++ b/zdev/src/select.c @@ -603,7 +603,7 @@ exit_code_t select_by_node(struct select_opts *select, devnode = devnode_from_node(path, err); if (!devnode) - return EXIT_RUNTIME_ERROR; + return EXIT_DEVICE_NOT_FOUND; rc = select_by_devnode(select, selected, config, scope, only_dt, only_st, devnode, path, err);