From 2d46b5361f0d28ac1860dc2f1a5ad8a5e5634b6b Mon Sep 17 00:00:00 2001 From: Bob Supnik Date: Sun, 21 May 2017 21:36:54 -0700 Subject: [PATCH] I1620: Separated EOF error from other IO errors (Dave Wise) --- I1620/i1620_pt.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/I1620/i1620_pt.c b/I1620/i1620_pt.c index e7d3eef3..35bd1632 100644 --- a/I1620/i1620_pt.c +++ b/I1620/i1620_pt.c @@ -1,6 +1,6 @@ /* 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 copy of this software and associated documentation files (the "Software"), @@ -26,6 +26,7 @@ ptr 1621 paper tape reader 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) 09-Feb-15 TFM Fixed numerous translation problems (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 { if ((temp = getc (ptr_unit.fileref)) == EOF) { /* read char */ 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"); + clearerr (ptr_unit.fileref); + return SCPE_EOF; + } else - sim_perror ("PTR I/O error");; + sim_perror ("PTR I/O error"); /* no, io err */ clearerr (ptr_unit.fileref); return SCPE_IOERR; }