PR/40144: Christoph Badura: quiting from vi recovery mode leaves tty settings

garbled. When vi creates a new EXF structure it did not set all the fd related
fields to -1, so if the fd field was never initialized, it was 0 because of
the calloc() call, so closing the file, ended up closing 0, so the terminal
fd was closed and that prevented the ioctl to restore the term settings from
succeeding.
This commit is contained in:
christos 2008-12-09 18:26:20 +00:00
parent cadb068686
commit 37d07dacae
1 changed files with 2 additions and 2 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: exf.c,v 1.2 2008/12/05 22:51:42 christos Exp $ */
/* $NetBSD: exf.c,v 1.3 2008/12/09 18:26:20 christos Exp $ */
/*-
* Copyright (c) 1992, 1993, 1994
@ -187,7 +187,7 @@ file_init(SCR *sp, FREF *frp, char *rcv_name, int flags)
CALLOC_RET(sp, ep, EXF *, 1, sizeof(EXF));
CIRCLEQ_INIT(&ep->scrq);
sp->c_lno = ep->c_nlines = OOBLNO;
ep->rcv_fd = ep->fcntl_fd = -1;
ep->fd = ep->rcv_fd = ep->fcntl_fd = -1;
F_SET(ep, F_FIRSTMODIFY);
/*