stinit: Change stinit to return one if setting one or more options fails

Previously, stinit returned zero even if it fails to set the options.
This patch changes the return value to one if one or more of the options
can't be set for a device if the tape numbers are given on command line.
If no numbers are given, stinit returns zero (as before this patch).
After this change, scripts (udev rules) can more easily detect when
stinit fails.

Signed-off-by: Kai Mäkisara <Kai.Makisara@kolumbus.fi>
This commit is contained in:
Kai Mäkisara
2025-01-05 16:26:21 +01:00
committed by Iustin Pop
parent ff108770be
commit 42dd44bb90
3 changed files with 30 additions and 15 deletions
+2 -2
View File
@@ -39,11 +39,11 @@
# 1000 tapes.
./stinit -f stinit.def.examples 1000
>>>2 /Can't find any device files for tape 1000/
>>>= 0
>>>= 1
./stinit -f stinit.def.examples 1000
>>>2 /Definition for '1000' failed/
>>>= 0
>>>= 1
# Wrong tape number (non-numeric).
./stinit -f stinit.def.examples 1000a