From 33676d6d23f1381a7984dd1b1fd4f1464317e6aa Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Thu, 25 Aug 2011 15:52:41 -0700 Subject: [PATCH] file.c: remove crazy keyboard open/close calls It seems to have something to do with some old DOS mode, and not having keyboard translation on ("Insert floppy A:" questions while opening files? Whatever). But this is while doing normal file opens, and it is just insane to open/close a tty across a file open. The possible tty init/exit sequence would mess up some of the file read/write messages. Reported-by: Bijan Soleymani Signed-off-by: Linus Torvalds --- file.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/file.c b/file.c index f3c980c..8125287 100644 --- a/file.c +++ b/file.c @@ -252,9 +252,6 @@ int readin(char *fname, int lockfl) /* let a user macro get hold of things...if he wants */ execute(META | SPEC | 'R', FALSE, 1); - /* turn off ALL keyboard translation in case we get a dos error */ - TTkclose(); - if ((s = ffropen(fname)) == FIOERR) /* Hard file open. */ goto out; @@ -305,7 +302,6 @@ int readin(char *fname, int lockfl) mlwrite(mesg); out: - TTkopen(); /* open the keyboard again */ for (wp = wheadp; wp != NULL; wp = wp->w_wndp) { if (wp->w_bufp == curbp) { wp->w_linep = lforw(curbp->b_linep); @@ -478,11 +474,8 @@ int writeout(char *fn) if (s != TRUE) return s; #endif - /* turn off ALL keyboard translation in case we get a dos error */ - TTkclose(); if ((s = ffwopen(fn)) != FIOSUC) { /* Open writes message. */ - TTkopen(); return FALSE; } mlwrite("(Writing...)"); /* tell us were writing */ @@ -504,7 +497,6 @@ int writeout(char *fn) } } else /* Ignore close error */ ffclose(); /* if a write error. */ - TTkopen(); if (s != FIOSUC) /* Some sort of error. */ return FALSE; return TRUE;