patch ttyrec.c