diff --git a/lang/m2/libm2/Terminal.mod b/lang/m2/libm2/Terminal.mod index 120aba796..c26a85691 100644 --- a/lang/m2/libm2/Terminal.mod +++ b/lang/m2/libm2/Terminal.mod @@ -19,7 +19,7 @@ IMPLEMENTATION MODULE Terminal; #else FROM Unix IMPORT read, write, open, ioctl; #endif - VAR fildes: INTEGER; + VAR fildes, fdout: INTEGER; unreadch: CHAR; unread: BOOLEAN; tty: ARRAY[0..8] OF CHAR; @@ -87,7 +87,7 @@ IMPLEMENTATION MODULE Terminal; PROCEDURE Write(ch: CHAR); BEGIN - IF write(fildes, ADR(ch), 1) < 0 THEN + IF write(fdout, ADR(ch), 1) < 0 THEN ; END; END Write; @@ -116,5 +116,6 @@ BEGIN (* dtrg: changed so that instead of opening /dev/tty, fd 0 is always used. *) tty := "stdio"; fildes := 0; + fdout := 1; unread := FALSE; END Terminal.