zdev: use consistent exit code for nonexistent device nodes

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 <vneethv@linux.ibm.com>
Signed-off-by: Peter Oberparleiter <oberpar@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
Peter Oberparleiter
2023-06-30 16:46:05 +02:00
committed by Jan Höppner
parent 743788d02f
commit 42611a787d

View File

@@ -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);