initctl: Follow priciple of least surprise for "cond get"

The accepted standard in Unix is to report successful executions with
exitcode 0. Therefore, map a "initctl cond get" of a condition to the
following exitcodes:

- On: 0
- Off: 1
- Flux: 255

Fixes: c3c662fe64 ("initctl: ensure 'cond get' support flux state")
Signed-off-by: Tobias Waldekranz <tobias@waldekranz.com>
This commit is contained in:
Tobias Waldekranz committed 2023-02-06 16:01:18 +01:00
1 parent 4f8a5a6531
commit c23a867485
2 files changed
+20 -16

No files matched your search

+1 -1
View File
@@ -145,7 +145,7 @@ or
then any condition can be read.
.Pp
The command is geared for scripting, check the exit code to get the
status of the condition: 0 - off, 1 - on, 255 - flux. For a more
status of the condition: 0 - on, 1 - off, 255 - flux. For a more
verbose output, use the
.Fl v
option.