hercules-390 / hyperion

Hercules 390
Other
248 stars 67 forks source link

CCKDDIAG prints mixed output to stdout and stderr #167

Closed erwinmars closed 7 years ago

erwinmars commented 7 years ago

CCKDDIAG prints output into stdout and stderr. For example if its called with options -d or -c, the header line of the DEVHDR is printed on stderr, but the corresponding dump is written to stdout. This is no problem, if the output is written to the console window. But if you would like to redirect the output to a file, you find the header line on the console window and the dump in the file. Also, if i redirect stdout and stderr, i find both in the file, but the dumps at the beginning and the headers at the end. That means, first, stdout is written and after that, stderr is written.

erwinmars commented 7 years ago

This is a complete sample output with 1. only stdout and 2. stdout and stderr redirected.

Only stdout redirected, Console output:

HHC01413I Hercules utility cckddiag - CCKD diagnostic program; version 4.0.0.8650-gb130229 (4.0.0.8650) HHC01414I (C) Copyright 1999-2016 by Roger Bowler, Jan Jaeger, and others HHC01415I Build date: Oct 14 2016 at 10:55:22 DEVHDR - 512 (decimal) bytes: CDEVHDR - 512 (decimal) bytes: L1TAB - 7680 (0x1E00) bytes: CC 1 HH 0 = reltrk 15; L1 index = 0, L2 index = 15 L1 index 0 = L2TAB offset 8704 (0x00002200) L2TAB - 2048 (decimal) bytes L2 index 15 = L2TAB entry 8 bytes TRKHDR offset -1835902301 (0x92925AA3); length 182 (0x00B6) TRKHDR track 15

CAPD19.3390-27.CCKD.diag.stdout.txt

CAPD19.3390-27.CCKD.diag.stdout-stderr.txt

Fish-Git commented 7 years ago

Upon initial quick examination it appears cckddiag was purposely written to print some messages to stdout and others to stderr. I have no idea (yet) why the behavior you describe is occurring. Let me look into it.