diff options
| author | Paul Eggert | 2018-12-02 23:11:09 -0800 |
|---|---|---|
| committer | Paul Eggert | 2018-12-02 23:55:01 -0800 |
| commit | f5090b91299cbd36901bef7b94aeef618b1bc6d8 (patch) | |
| tree | d5dffd1d6cc0fb6acf8aa4b99baa41d0f121f4ec /src | |
| parent | 25a33aa2d173d933af294a7ea130960c720e1be5 (diff) | |
| download | emacs-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 'src')
| -rw-r--r-- | src/Makefile.in | 3 | ||||
| -rw-r--r-- | src/sysdep.c | 8 |
2 files changed, 5 insertions, 6 deletions
diff --git a/src/Makefile.in b/src/Makefile.in index 2dba1026c34..6b2e54a1602 100644 --- a/src/Makefile.in +++ b/src/Makefile.in | |||
| @@ -141,7 +141,6 @@ M17N_FLT_LIBS = @M17N_FLT_LIBS@ | |||
| 141 | LIB_ACL=@LIB_ACL@ | 141 | LIB_ACL=@LIB_ACL@ |
| 142 | LIB_CLOCK_GETTIME=@LIB_CLOCK_GETTIME@ | 142 | LIB_CLOCK_GETTIME=@LIB_CLOCK_GETTIME@ |
| 143 | LIB_EACCESS=@LIB_EACCESS@ | 143 | LIB_EACCESS=@LIB_EACCESS@ |
| 144 | LIB_FDATASYNC=@LIB_FDATASYNC@ | ||
| 145 | LIB_TIMER_TIME=@LIB_TIMER_TIME@ | 144 | LIB_TIMER_TIME=@LIB_TIMER_TIME@ |
| 146 | 145 | ||
| 147 | DBUS_CFLAGS = @DBUS_CFLAGS@ | 146 | DBUS_CFLAGS = @DBUS_CFLAGS@ |
| @@ -496,7 +495,7 @@ LIBES = $(LIBS) $(W32_LIBS) $(LIBS_GNUSTEP) $(LIBX_BASE) $(LIBIMAGE) \ | |||
| 496 | $(LIBX_OTHER) $(LIBSOUND) \ | 495 | $(LIBX_OTHER) $(LIBSOUND) \ |
| 497 | $(RSVG_LIBS) $(IMAGEMAGICK_LIBS) $(LIB_ACL) $(LIB_CLOCK_GETTIME) \ | 496 | $(RSVG_LIBS) $(IMAGEMAGICK_LIBS) $(LIB_ACL) $(LIB_CLOCK_GETTIME) \ |
| 498 | $(WEBKIT_LIBS) \ | 497 | $(WEBKIT_LIBS) \ |
| 499 | $(LIB_EACCESS) $(LIB_FDATASYNC) $(LIB_TIMER_TIME) $(DBUS_LIBS) \ | 498 | $(LIB_EACCESS) $(LIB_TIMER_TIME) $(DBUS_LIBS) \ |
| 500 | $(LIB_EXECINFO) $(XRANDR_LIBS) $(XINERAMA_LIBS) $(XFIXES_LIBS) \ | 499 | $(LIB_EXECINFO) $(XRANDR_LIBS) $(XINERAMA_LIBS) $(XFIXES_LIBS) \ |
| 501 | $(XDBE_LIBS) \ | 500 | $(XDBE_LIBS) \ |
| 502 | $(LIBXML2_LIBS) $(LIBGPM) $(LIBS_SYSTEM) $(CAIRO_LIBS) \ | 501 | $(LIBXML2_LIBS) $(LIBGPM) $(LIBS_SYSTEM) $(CAIRO_LIBS) \ |
diff --git a/src/sysdep.c b/src/sysdep.c index ddcb594f668..b054839795b 100644 --- a/src/sysdep.c +++ b/src/sysdep.c | |||
| @@ -1519,19 +1519,19 @@ reset_sys_modes (struct tty_display_info *tty_out) | |||
| 1519 | if (tty_out->terminal->reset_terminal_modes_hook) | 1519 | if (tty_out->terminal->reset_terminal_modes_hook) |
| 1520 | tty_out->terminal->reset_terminal_modes_hook (tty_out->terminal); | 1520 | tty_out->terminal->reset_terminal_modes_hook (tty_out->terminal); |
| 1521 | 1521 | ||
| 1522 | #ifndef DOS_NT | ||
| 1522 | /* Avoid possible loss of output when changing terminal modes. */ | 1523 | /* Avoid possible loss of output when changing terminal modes. */ |
| 1523 | while (fdatasync (fileno (tty_out->output)) != 0 && errno == EINTR) | 1524 | while (tcdrain (fileno (tty_out->output)) != 0 && errno == EINTR) |
| 1524 | continue; | 1525 | continue; |
| 1525 | 1526 | ||
| 1526 | #ifndef DOS_NT | 1527 | # ifdef F_SETOWN |
| 1527 | #ifdef F_SETOWN | ||
| 1528 | if (interrupt_input) | 1528 | if (interrupt_input) |
| 1529 | { | 1529 | { |
| 1530 | reset_sigio (fileno (tty_out->input)); | 1530 | reset_sigio (fileno (tty_out->input)); |
| 1531 | fcntl (fileno (tty_out->input), F_SETOWN, | 1531 | fcntl (fileno (tty_out->input), F_SETOWN, |
| 1532 | old_fcntl_owner[fileno (tty_out->input)]); | 1532 | old_fcntl_owner[fileno (tty_out->input)]); |
| 1533 | } | 1533 | } |
| 1534 | #endif /* F_SETOWN */ | 1534 | # endif /* F_SETOWN */ |
| 1535 | fcntl (fileno (tty_out->input), F_SETFL, | 1535 | fcntl (fileno (tty_out->input), F_SETFL, |
| 1536 | fcntl (fileno (tty_out->input), F_GETFL, 0) & ~O_NONBLOCK); | 1536 | fcntl (fileno (tty_out->input), F_GETFL, 0) & ~O_NONBLOCK); |
| 1537 | #endif | 1537 | #endif |