	SUBROUTINE BRKCTRAP(TTCHAN)
	IMPLICIT INTEGER(A-Z)
	INTEGER*4 icode, sys$cancel, ttchan
	CHARACTER*31 original_user
	LOGICAL updating
	COMMON original_user
	COMMON updating
	EXTERNAL netmail_ctrlc, netmail_updint
	PARAMETER (LIB$M_CLI_CTRLY = '02000000'X)
C
C	Cancel all I/Os on terminal channel
C
	icode = SYS$CANCEL(%VAL(ttchan))
	if (.not.icode) CALL LIB$STOP(%VAL(icode))
C
C	Close NETMAIL file.
C
	CLOSE(unit=1)
C
C	Enable CTRL-Y.
C
	icode = LIB$ENABLE_CTRL(lib$m_cli_ctrly)
	if (.not.icode) CALL LIB$STOP(%val(icode))
C
C	Display error messages.
C
	if (updating) CALL LIB$SIGNAL(netmail_updint)
	CALL LIB$SIGNAL(netmail_ctrlc)
C
	return
	end
