aboutsummaryrefslogtreecommitdiffstats
path: root/src/sysdep.c
diff options
context:
space:
mode:
authorPaul Eggert2013-03-13 11:42:22 -0700
committerPaul Eggert2013-03-13 11:42:22 -0700
commit47d7532e093db8a5068a40c587915121ffaaad18 (patch)
treea99ea6eca34ea0e9c8d6e8a8d6291833ce27dca5 /src/sysdep.c
parentc7ffccaf17d63cefd34bef0a9becc4e68df3b115 (diff)
downloademacs-47d7532e093db8a5068a40c587915121ffaaad18.tar.gz
emacs-47d7532e093db8a5068a40c587915121ffaaad18.zip
File synchronization fixes.
* admin/CPP-DEFINES (BSD_SYSTEM, HAVE_FSYNC): Remove. * admin/merge-gnulib (GNULIB_MODULES): Add fsync, fdatasync. * configure.ac (BSD_SYSTEM, BSD_SYSTEM_AHB): Remove; no longer needed. (fsync): Remove check; now done by gnulib. * lib/fdatasync.c, lib/fsync.c, m4/fdatasync.m4, m4/fsync.m4: New files, from gnulib. * lib/gnulib.mk, m4/gnulib-comp.m4: Regenerate. * lib-src/Makefile.in (LIB_FDATASYNC): New macro. (emacsclient${EXEEXT}): Use it. * lib-src/emacsclient.c (main): Use fdatasync, not fsync, since we don't care about metadata. Keep trying if interrupted. * lib-src/movemail.c (main, popmail): Don't worry about BSD_SYSTEM, since fsync is available everywhere (or there is a substitute). Don't report an error if fsync returns EINVAL. * nt/inc/ms-w32.h (fdatasync): New macro, suggested by Eli Zaretskii. * src/Makefile.in (LIB_FDATASYNC): New macro. (LIBES): Use it. * src/conf_post.h (BSD_SYSTEM, BSD_SYSTEM_AHB): Remove; no longer needed. * src/fileio.c (Fwrite_region, write_region_inhibit_fsync): Don't worry about HAVE_FSYNC, since a substitute fsync is available if the system lacks one. (Fwrite_regin): Retry fsync if interrupted. Fixes: debbugs:13944
Diffstat (limited to 'src/sysdep.c')
-rw-r--r--src/sysdep.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/sysdep.c b/src/sysdep.c
index b99f179210c..bff11fc9f75 100644
--- a/src/sysdep.c
+++ b/src/sysdep.c
@@ -1289,10 +1289,9 @@ reset_sys_modes (struct tty_display_info *tty_out)
1289 if (tty_out->terminal->reset_terminal_modes_hook) 1289 if (tty_out->terminal->reset_terminal_modes_hook)
1290 tty_out->terminal->reset_terminal_modes_hook (tty_out->terminal); 1290 tty_out->terminal->reset_terminal_modes_hook (tty_out->terminal);
1291 1291
1292#ifdef BSD_SYSTEM
1293 /* Avoid possible loss of output when changing terminal modes. */ 1292 /* Avoid possible loss of output when changing terminal modes. */
1294 fsync (fileno (tty_out->output)); 1293 while (fdatasync (fileno (tty_out->output)) != 0 && errno == EINTR)
1295#endif 1294 continue;
1296 1295
1297#ifndef DOS_NT 1296#ifndef DOS_NT
1298#ifdef F_SETOWN 1297#ifdef F_SETOWN