1
0
mirror of https://github.com/PDP-10/its.git synced 2026-03-09 12:30:45 +00:00

Fix Muddle's CLOSE not flushing the output buffer.

There were two problems here:

- The FOPEN code in 56 uses new C.DISK/C.TTY flags to keep track of the
  channel type, so it knew what to do when closing the channel. The
  TOPS-20 open code had been modified to set these, but the ITS code
  hadn't, so CLOSE was assuming all channels were network channels.

  Fix: set those flags in ODSK and OTTY, as TOPS-20 does.

- The BFCDSK flush routine had been modified to use byte pointer writes
  to write the last incomplete word for both TOPS-20 (SOUT) and ITS
  (SIOT). But on ITS, SIOT only works in unit mode, and Muddle opens
  files in block mode.

  Fix: restore the working code from Muddle 54 for writing the last
  word. The only difference is that BFCDSK can now be invoked with the
  leftover byte count (C) being zero, so it needs to check at the
  start to avoid duplicating the last word in that case.
This commit is contained in:
Adam Sampson
2020-09-19 23:41:34 +01:00
committed by Lars Brinkhoff
parent 88f5a7262c
commit 1a6115e949

View File

@@ -896,6 +896,8 @@ IFN ITS,[
ODSK: MOVE A,S.SNM(C) ; GET SNAME
.SUSET [.SSNAM,,A] ; CLOBBER IT
PUSHJ P,OPEN0 ; DO REAL LIVE OPEN
MOVEI 0,C.DISK
IORM 0,-2(B)
]
IFE ITS,[
@@ -1759,6 +1761,8 @@ TTYLP2: MOVE C,T.SPDL+1(TB) ; POINT TO P BASE
IORI A,20 ; THEN USE DISPLAY MODE
HRLM A,S.DIR(C) ; STORE IN OPEN BLOCK
PUSHJ P,OPEN2 ; OPEN THE TTY
MOVEI 0,C.TTY
IORM 0,-2(B)
MOVE A,S.DEV(C) ; GET DEVICE NAME
PUSHJ P,6TOCHS ; TO A STRING
MOVE D,T.CHAN+1(TB) ; POINT TO CHANNEL
@@ -4223,9 +4227,19 @@ IFE ITS,[
SUB TP,[2,,2]
]
IFN ITS,[
MOVE D,[440700,,A]
DOTCAL SIOT,[CHANNO(B),D,C]
.LOSE %LSFIL ;PRESUMABLY LOSSAGE MATTERS
JUMPE C,BFCDF2 ; NO CHARS LEFT TO WRITE?
PUSH P,[-5] ; KLUDGE ADDED TO FILL LAST WORD WITH ^C
ADDM C,(P)
MOVE C,A ; FOR FUNNY AOBJN PTR
HLL C,BUFSTR(B) ; POINT INTO WORD AFTER LAST CHAR
MOVEM 0,(A)
MOVEI 0,3 ; CONTROL C
BFCDF1: IDPB 0,C
AOSE (P)
JRST BFCDF1
SUB P,[1,,1]
PUSHJ P,PGBIOO
BFCDF2:
]
POP P,C
JUMPN C,BFCLSD