spinhawk icon indicating copy to clipboard operation
spinhawk copied to clipboard

dasdls writes on Linux to stdin, does 'write(0,....)'

Open wfjm opened this issue 6 years ago • 1 comments

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

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.

wfjm avatar Jun 01 '18 17:06 wfjm

... while the dasdls from hercules-390/hyperion does no writes to stdin.

FWIW, neither does SoftDevLabs's Fish-Git Hyperion either.

Fish-Git avatar Jun 01 '18 18:06 Fish-Git