]> git.eshelyaron.com Git - emacs.git/commit
Fix emacsclient hang when backgrounded
authorPaul Eggert <eggert@cs.ucla.edu>
Thu, 6 Dec 2018 16:54:00 +0000 (08:54 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Thu, 6 Dec 2018 18:48:04 +0000 (10:48 -0800)
commit2f985977f691a37a6d45298128b88d0cefcc93a1
treeae4c47f464e89d2a48593ea17da7ac3f4dd10058
parentc5b6f1672bc62d9ffdd3c7200074727a4608af03
Fix emacsclient hang when backgrounded

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