spinhawk
spinhawk copied to clipboard
dasdls writes on Linux to stdin, does 'write(0,....)'
I use dasdls
under Linux. First I saw that two lines of the dasdls
output can't be redirected to a file, they always show up in the controlling terminal. Only with unbuffer(1)
one gets the whole output redirected into a file. The lines are
HHCDA004I opening mvsres.148 readonly
HHCDA020I mvsres.148 cyls=560 heads=30 tracks=16800 trklen=19456
Running dasdls
under strace(1)
gives
write(2, "Hercules DASD list program Versi"...,
write(2, "(c)Copyright 1999-2015 by Roger "...,
write(0, "HHCDA004I opening mvsres.148 rea"...,
write(0, "HHCDA020I mvsres.148 cyls=560 he"...,
write(1, "mvsres.148: VOLSER=MVSRES\nZ99999"...,
So there are writes to stdout
and stderr
, but also two writes to stdin
. The issue can be reproduced with the current HEAD (commit 59f0556) and can be traced to
-
ckddasd.c#L357-L359 -->
logmsg (_("HHCDA004I opening...
-
logmsg.c#L159-L160 -->
log_write(0,bfr)
-
logmsg.c#L247-L268 -->
log_write(int panel,char *msg)
The logic of log_write
finally poduces somehow a write(0,...)
in the context of dasdls
.
The dasdls
coming with tk4- exhibits the same issue, while the dasdls
from hercules-390/hyperion does no writes to stdin
.
... while the dasdls from hercules-390/hyperion does no writes to stdin.
FWIW, neither does SoftDevLabs's Fish-Git Hyperion either.