>From 2f985977f691a37a6d45298128b88d0cefcc93a1 Mon Sep 17 00:00:00 2001 From: Paul Eggert
Date: Thu, 6 Dec 2018 08:54:00 -0800 Subject: [PATCH 1/2] Fix emacsclient hang when backgrounded MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Problem reported by Kaushal Modi in: https://lists.gnu.org/r/emacs-devel/2018-12/msg00083.html The tcdrain call replaced an fdatasync call which had no effect on the tty, so removing it entirely shouldnât cause problems. The fdatasync call replaced an fsync call which also had no effect on the tty, and the fsync call seems to be badly-merged revenant of emacsclientâs old (circa 2004) way of communicating to and from Emacs via FILE * streams, where fsync was apparently needed when talking to sockets. * lib-src/emacsclient.c [!DOS_NT]: Donât include termios.h. (flush_stdout): Remove. All callers removed. (main): Do not drain the tty after "Waiting for Emacs..." message. There should be no need to drain, and draining it might send us a SIGTTOU. Do not fflush stdout just before exiting, as exiting does that for us. --- lib-src/emacsclient.c | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/lib-src/emacsclient.c b/lib-src/emacsclient.c index 7de3665114..653ab955df 100644 --- a/lib-src/emacsclient.c +++ b/lib-src/emacsclient.c @@ -66,10 +66,6 @@ char *w32_getenv (const char *); #endif /* !WINDOWSNT */ -#ifndef DOS_NT -# include