Symptoms:
/etc/rmt exits after the final A correctly(?) returning
the mt_flags (A327680) member.
(The tape device is open(2)ed nonblocking to retrieve the
status as it doesn't have a tape loaded.)
I-1
0
A1
O/dev/st0
O_RDWR|O_NONBLOCK
A0
sf
A327680
dump-0.4b47/rmt/rmt.c
489 case 's':
490 { char s;
...
495 if (read (0, &s, 1) != 1)
496 goto top;
Line 495 only consumes the 's' subcommand leaving the trailing '\n'
for the read on line 140 which exits fthout the switch default (line 544)
145 if (read(0, &c, 1) != 1)
146 exit(0);
147 switch (c) {
Simple fix is to read the subcommand with getstring
- if (read (0, &s, 1) != 1)
+ getstring (op);
+ s = op [0];
+ if (s == '\n')
goto top;
Please close.
Should have read the fine manual :)
Both the 'S' and 's' commands aren't terminated by '\n'
So one way to test is with the V1 version 'v' command after the 's' cmd
eg retrieve mt_blkno
sBv
A1
A1
glad you were able to figure it out