I1620: Separated EOF error from other IO errors (Dave Wise)

This commit is contained in:
Bob Supnik 2017-05-21 21:36:54 -07:00 committed by Mark Pizzolato
parent a9cd426701
commit 2d46b5361f

View file

@ -1,6 +1,6 @@
/* i1620_pt.c: IBM 1621/1624 paper tape reader/punch simulator /* i1620_pt.c: IBM 1621/1624 paper tape reader/punch simulator
Copyright (c) 2002-2015, Robert M Supnik Copyright (c) 2002-2017, Robert M Supnik
Permission is hereby granted, free of charge, to any person obtaining a Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"), copy of this software and associated documentation files (the "Software"),
@ -26,6 +26,7 @@
ptr 1621 paper tape reader ptr 1621 paper tape reader
ptp 1624 paper tape punch ptp 1624 paper tape punch
18-May-17 RMS Separated EOF error from other IO errors (Dave Wise)
23-Feb-15 TFM Fixed RA, RBPT to preserve flags on RM at end (Tom McBride) 23-Feb-15 TFM Fixed RA, RBPT to preserve flags on RM at end (Tom McBride)
09-Feb-15 TFM Fixed numerous translation problems (Tom McBride) 09-Feb-15 TFM Fixed numerous translation problems (Tom McBride)
09-Feb-15 TFM Fixed pack/unpack errors in binary r/w (Tom McBride) 09-Feb-15 TFM Fixed pack/unpack errors in binary r/w (Tom McBride)
@ -331,10 +332,13 @@ if ((ptr_unit.flags & UNIT_ATT) == 0) { /* attached? */
do { do {
if ((temp = getc (ptr_unit.fileref)) == EOF) { /* read char */ if ((temp = getc (ptr_unit.fileref)) == EOF) { /* read char */
ind[IN_RDCHK] = 1; /* err, rd chk */ ind[IN_RDCHK] = 1; /* err, rd chk */
if (feof (ptr_unit.fileref)) if (feof (ptr_unit.fileref)) { /* EOF? */
sim_printf ("PTR end of file\n"); sim_printf ("PTR end of file\n");
clearerr (ptr_unit.fileref);
return SCPE_EOF;
}
else else
sim_perror ("PTR I/O error");; sim_perror ("PTR I/O error"); /* no, io err */
clearerr (ptr_unit.fileref); clearerr (ptr_unit.fileref);
return SCPE_IOERR; return SCPE_IOERR;
} }