aboutsummaryrefslogtreecommitdiffstats
path: root/lib-src
diff options
context:
space:
mode:
authorPaul Eggert2018-12-02 23:11:09 -0800
committerPaul Eggert2018-12-02 23:55:01 -0800
commitf5090b91299cbd36901bef7b94aeef618b1bc6d8 (patch)
treed5dffd1d6cc0fb6acf8aa4b99baa41d0f121f4ec /lib-src
parent25a33aa2d173d933af294a7ea130960c720e1be5 (diff)
downloademacs-f5090b91299cbd36901bef7b94aeef618b1bc6d8.tar.gz
emacs-f5090b91299cbd36901bef7b94aeef618b1bc6d8.zip
Use tcdrain, not fdatasync, to drain ttys
fdatasync is for storage devices, not ttys. * admin/merge-gnulib (GNULIB_MODULES): Remove fdatasync. * lib/fdatasync.c, m4/fdatasync.m4: Remove. * lib-src/Makefile.in (LIB_FDATASYNC): * src/Makefile.in (LIB_FDATASYNC): Remove. All uses removed. * lib-src/emacsclient.c [!DOS_NT]: Include <termios.h>, for tcdrain. * lib-src/emacsclient.c (flush_stdout): * src/sysdep.c (reset_sys_modes): On ttys, use tcdrain instead of fdatasync (except don’t use either function if DOS_NT). * lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
Diffstat (limited to 'lib-src')
-rw-r--r--lib-src/Makefile.in6
-rw-r--r--lib-src/emacsclient.c8
2 files changed, 9 insertions, 5 deletions
diff --git a/lib-src/Makefile.in b/lib-src/Makefile.in
index ecb9208a1cd..00151933caa 100644
--- a/lib-src/Makefile.in
+++ b/lib-src/Makefile.in
@@ -204,8 +204,6 @@ LIBRESOLV=@LIBRESOLV@
204LIBS_MAIL=@LIBS_MAIL@ 204LIBS_MAIL=@LIBS_MAIL@
205## empty or -lrt or -lposix4 if HAVE_CLOCK_GETTIME 205## empty or -lrt or -lposix4 if HAVE_CLOCK_GETTIME
206LIB_CLOCK_GETTIME = @LIB_CLOCK_GETTIME@ 206LIB_CLOCK_GETTIME = @LIB_CLOCK_GETTIME@
207## empty or -lrt or -lposix4 if HAVE_FDATASYNC
208LIB_FDATASYNC = @LIB_FDATASYNC@
209## empty or -lwsock2 for MinGW 207## empty or -lwsock2 for MinGW
210LIB_WSOCK32=@LIB_WSOCK32@ 208LIB_WSOCK32=@LIB_WSOCK32@
211 209
@@ -396,12 +394,12 @@ pop.o: ${srcdir}/pop.c ${srcdir}/pop.h ${srcdir}/../lib/min-max.h $(config_h)
396 394
397emacsclient${EXEEXT}: ${srcdir}/emacsclient.c $(NTLIB) $(config_h) 395emacsclient${EXEEXT}: ${srcdir}/emacsclient.c $(NTLIB) $(config_h)
398 $(AM_V_CCLD)$(CC) ${ALL_CFLAGS} $< \ 396 $(AM_V_CCLD)$(CC) ${ALL_CFLAGS} $< \
399 -DVERSION="\"${version}\"" $(NTLIB) $(LOADLIBES) $(LIB_FDATASYNC) \ 397 -DVERSION="\"${version}\"" $(NTLIB) $(LOADLIBES) \
400 $(LIB_WSOCK32) $(LIBS_ECLIENT) -o $@ 398 $(LIB_WSOCK32) $(LIBS_ECLIENT) -o $@
401 399
402emacsclientw${EXEEXT}: ${srcdir}/emacsclient.c $(NTLIB) $(CLIENTRES) $(config_h) 400emacsclientw${EXEEXT}: ${srcdir}/emacsclient.c $(NTLIB) $(CLIENTRES) $(config_h)
403 $(AM_V_CCLD)$(CC) ${ALL_CFLAGS} $(CLIENTRES) -mwindows $< \ 401 $(AM_V_CCLD)$(CC) ${ALL_CFLAGS} $(CLIENTRES) -mwindows $< \
404 -DVERSION="\"${version}\"" $(LOADLIBES) $(LIB_FDATASYNC) \ 402 -DVERSION="\"${version}\"" $(LOADLIBES) \
405 $(LIB_WSOCK32) $(LIBS_ECLIENT) -o $@ 403 $(LIB_WSOCK32) $(LIBS_ECLIENT) -o $@
406 404
407NTINC = ${srcdir}/../nt/inc 405NTINC = ${srcdir}/../nt/inc
diff --git a/lib-src/emacsclient.c b/lib-src/emacsclient.c
index df44bc4087c..1c62c09451c 100644
--- a/lib-src/emacsclient.c
+++ b/lib-src/emacsclient.c
@@ -65,6 +65,10 @@ char *w32_getenv (const char *);
65 65
66#endif /* !WINDOWSNT */ 66#endif /* !WINDOWSNT */
67 67
68#ifndef DOS_NT
69# include <termios.h>
70#endif
71
68#include <ctype.h> 72#include <ctype.h>
69#include <errno.h> 73#include <errno.h>
70#include <getopt.h> 74#include <getopt.h>
@@ -1722,8 +1726,10 @@ static void
1722flush_stdout (HSOCKET emacs_socket) 1726flush_stdout (HSOCKET emacs_socket)
1723{ 1727{
1724 fflush (stdout); 1728 fflush (stdout);
1725 while (fdatasync (STDOUT_FILENO) != 0 && errno == EINTR) 1729#ifndef DOS_NT
1730 while (tcdrain (STDOUT_FILENO) != 0 && errno == EINTR)
1726 act_on_signals (emacs_socket); 1731 act_on_signals (emacs_socket);
1732#endif
1727} 1733}
1728 1734
1729int 1735int