Now on revision 112041. ------------------------------------------------------------ revno: 112041 committer: Daniel Colascione branch nick: trunk timestamp: Wed 2013-03-13 11:28:50 -0800 message: * emacs.c (main): Call syms_of_cygw32 on CYGWIN non-NTGUI builds too so that these builds can use Cygwin's file conversion functions. (We've been building and linking cygw32.o all along and just not using it.) diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2013-03-13 18:42:22 +0000 +++ src/ChangeLog 2013-03-13 19:28:50 +0000 @@ -1,3 +1,10 @@ +2013-03-13 Daniel Colascione + + * emacs.c (main): Call syms_of_cygw32 on CYGWIN non-NTGUI builds + too so that these builds can use Cygwin's file conversion + functions. (We've been building and linking cygw32.o all along + and just not using it.) + 2013-03-13 Paul Eggert File synchronization fixes (Bug#13944). === modified file 'src/emacs.c' --- src/emacs.c 2013-02-25 05:55:37 +0000 +++ src/emacs.c 2013-03-13 19:28:50 +0000 @@ -44,7 +44,7 @@ #include "w32common.h" #endif -#if defined HAVE_NTGUI && defined CYGWIN +#if defined CYGWIN #include "cygw32.h" #endif @@ -1348,7 +1348,7 @@ #ifdef WINDOWSNT syms_of_ntproc (); #endif /* WINDOWSNT */ -#if defined CYGWIN && defined HAVE_NTGUI +#if defined CYGWIN syms_of_cygw32 (); #endif syms_of_window (); ------------------------------------------------------------ revno: 112040 committer: Karl Fogel branch nick: trunk timestamp: Wed 2013-03-13 13:54:05 -0500 message: * saveplace.el (save-place-alist-to-file): Don't sort `save-place-alist', just pretty-print it (bug#13882). diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-03-13 11:38:13 +0000 +++ lisp/ChangeLog 2013-03-13 18:54:05 +0000 @@ -1,3 +1,8 @@ +2013-03-13 Karl Fogel + + * saveplace.el (save-place-alist-to-file): Don't sort + `save-place-alist', just pretty-print it (bug#13882). + 2013-03-13 Michael Albinus * net/tramp-sh.el (tramp-sh-handle-insert-directory): Check, === modified file 'lisp/saveplace.el' --- lisp/saveplace.el 2013-03-12 02:08:21 +0000 +++ lisp/saveplace.el 2013-03-13 18:54:05 +0000 @@ -224,9 +224,7 @@ (symbol-name coding-system-for-write))) (let ((print-length nil) (print-level nil)) - (pp (sort save-place-alist - (lambda (a b) (string< (car a) (car b)))) - (current-buffer))) + (pp save-place-alist (current-buffer))) (let ((version-control (cond ((null save-place-version-control) nil) ------------------------------------------------------------ revno: 112039 fixes bug: http://debbugs.gnu.org/13944 committer: Paul Eggert branch nick: trunk timestamp: Wed 2013-03-13 11:42:22 -0700 message: 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. diff: === modified file 'ChangeLog' --- ChangeLog 2013-03-13 07:15:17 +0000 +++ ChangeLog 2013-03-13 18:42:22 +0000 @@ -1,5 +1,12 @@ 2013-03-13 Paul Eggert + File synchronization fixes (Bug#13944). + * 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. + Merge from gnulib, incorporating: 2013-03-13 putenv: port to Solaris 10 2013-03-12 mktime: fix configure typo === modified file 'admin/CPP-DEFINES' --- admin/CPP-DEFINES 2013-02-25 05:55:37 +0000 +++ admin/CPP-DEFINES 2013-03-13 18:42:22 +0000 @@ -9,7 +9,6 @@ AIX _AIX -BSD_SYSTEM CYGWIN Compiling the Cygwin port. __CYGWIN__ Ditto GNU_LINUX @@ -149,7 +148,6 @@ HAVE_FREEIFADDRS HAVE_FREETYPE HAVE_FSEEKO -HAVE_FSYNC HAVE_FUTIMENS HAVE_FUTIMES HAVE_FUTIMESAT === modified file 'admin/ChangeLog' --- admin/ChangeLog 2013-03-11 22:32:07 +0000 +++ admin/ChangeLog 2013-03-13 18:42:22 +0000 @@ -1,3 +1,9 @@ +2013-03-13 Paul Eggert + + File synchronization fixes (Bug#13944). + * CPP-DEFINES (BSD_SYSTEM, HAVE_FSYNC): Remove. + * merge-gnulib (GNULIB_MODULES): Add fsync, fdatasync. + 2013-03-11 Paul Eggert * notes/unicode: Improve notes about Emacs source file encoding. === modified file 'admin/merge-gnulib' --- admin/merge-gnulib 2013-02-11 23:37:18 +0000 +++ admin/merge-gnulib 2013-03-13 18:42:22 +0000 @@ -29,7 +29,8 @@ alloca-opt c-ctype c-strcase careadlinkat close-stream crypto/md5 crypto/sha1 crypto/sha256 crypto/sha512 dtoastr dtotimespec dup2 environ execinfo faccessat - fcntl-h fdopendir filemode fstatat getloadavg getopt-gnu gettime gettimeofday + fcntl-h fdatasync fdopendir filemode fstatat fsync + getloadavg getopt-gnu gettime gettimeofday ignore-value intprops largefile lstat manywarnings memrchr mktime pselect pthread_sigmask putenv readlink readlinkat === modified file 'configure.ac' --- configure.ac 2013-03-06 08:01:47 +0000 +++ configure.ac 2013-03-13 18:42:22 +0000 @@ -2872,7 +2872,7 @@ utimes getrlimit setrlimit shutdown getaddrinfo \ strsignal setitimer \ sendto recvfrom getsockname getpeername getifaddrs freeifaddrs \ -gai_strerror mkstemp getline getdelim fsync sync \ +gai_strerror mkstemp getline getdelim sync \ difftime posix_memalign \ getpwent endpwent getgrent endgrent \ touchlock \ @@ -3774,7 +3774,6 @@ dnl Define symbols to identify the version of Unix this is. dnl Define all the symbols that apply correctly. -AH_TEMPLATE(BSD_SYSTEM, [Define if the system is compatible with BSD 4.2.]) AH_TEMPLATE(DOS_NT, [Define if the system is MS DOS or MS Windows.]) AH_TEMPLATE(MSDOS, [Define if the system is MS DOS.]) AH_TEMPLATE(USG, [Define if the system is compatible with System III.]) @@ -3798,30 +3797,12 @@ ;; darwin) - dnl BSD4_3 and BSD4_4 are already defined in sys/param.h. - AC_DEFINE(BSD_SYSTEM, []) - dnl More specific than the above two. We cannot use __APPLE__ as this - dnl may not be defined on non-OSX Darwin, and we cannot define DARWIN - dnl here because Panther and lower CoreFoundation.h uses DARWIN to + dnl Not __APPLE__, as this may not be defined on non-OSX Darwin. + dnl Not DARWIN, because Panther and lower CoreFoundation.h use DARWIN to dnl distinguish OS X from pure Darwin. AC_DEFINE(DARWIN_OS, [], [Define if the system is Darwin.]) ;; - freebsd) - dnl Hack to avoid calling AC_PREPROC_IFELSE multiple times. - dnl Would not be needed with autoconf >= 2.67, where the - dnl preprocessed output is accessible in "conftest.i". - AC_DEFINE(BSD_SYSTEM_AHB, 1, [Define if AH_BOTTOM should change BSD_SYSTEM.]) - ;; - - gnu | netbsd | openbsd ) - AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[ -#ifndef BSD_SYSTEM -# error "BSD_SYSTEM not defined" -#endif - ]], [[]])], [], AC_DEFINE(BSD_SYSTEM, 43) ) - ;; - gnu-linux | gnu-kfreebsd ) AC_DEFINE(USG, []) AC_DEFINE(GNU_LINUX, [], [Define if ths system is compatible with GNU/Linux.]) @@ -4185,15 +4166,8 @@ LD_SWITCH_SYSTEM_TEMACS="-fno-pie -prebind $libs_nsgui -Xlinker -headerpad -Xlinker $headerpad_extra" ## This is here because src/Makefile.in did some extra fiddling around - ## with LD_SWITCH_SYSTEM. The cpp logic was: - ## #ifndef LD_SWITCH_SYSTEM - ## #if !defined (__GNUC__) && ((defined (BSD_SYSTEM) && !defined (COFF))) - ## Since all the *bsds define LD_SWITCH_SYSTEM, this simplifies to: - ## not using gcc, darwin. - ## Because this was done in src/Makefile.in, the resulting part of - ## LD_SWITCH_SYSTEM was not used in configure (ie, in ac_link). - ## It therefore seems cleaner to put this in LD_SWITCH_SYSTEM_TEMACS, - ## rather than LD_SWITCH_SYSTEM. + ## with LD_SWITCH_SYSTEM. It seems cleaner to put this in + ## LD_SWITCH_SYSTEM_TEMACS instead, test "x$LD_SWITCH_SYSTEM" = "x" && test "x$GCC" != "xyes" && \ LD_SWITCH_SYSTEM_TEMACS="-X $LD_SWITCH_SYSTEM_TEMACS" ;; === modified file 'lib-src/ChangeLog' --- lib-src/ChangeLog 2013-03-13 07:27:34 +0000 +++ lib-src/ChangeLog 2013-03-13 18:42:22 +0000 @@ -1,5 +1,14 @@ 2013-03-13 Paul Eggert + File synchronization fixes (Bug#13944). + * Makefile.in (LIB_FDATASYNC): New macro. + (emacsclient${EXEEXT}): Use it. + * emacsclient.c (main): Use fdatasync, not fsync, since we don't + care about metadata. Keep trying if interrupted. + * 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. + Static checking by Sun C 5.12. * etags.c (analyse_regex): Omit unreachable code. === modified file 'lib-src/Makefile.in' --- lib-src/Makefile.in 2013-01-01 09:11:05 +0000 +++ lib-src/Makefile.in 2013-03-13 18:42:22 +0000 @@ -161,6 +161,8 @@ LIBS_MAIL=@LIBS_MAIL@ ## empty or -lrt or -lposix4 if HAVE_CLOCK_GETTIME LIB_CLOCK_GETTIME = @LIB_CLOCK_GETTIME@ +## empty or -lrt or -lposix4 if HAVE_FDATASYNC +LIB_FDATASYNC = @LIB_FDATASYNC@ ## Extra libraries to use when linking movemail. LIBS_MOVE = $(LIBS_MAIL) $(KRB4LIB) $(DESLIB) $(KRB5LIB) $(CRYPTOLIB) \ @@ -334,7 +336,7 @@ emacsclient${EXEEXT}: ${srcdir}/emacsclient.c $(config_h) $(CC) ${ALL_CFLAGS} ${srcdir}/emacsclient.c \ -DVERSION="\"${version}\"" \ - $(LOADLIBES) -o emacsclient + $(LOADLIBES) $(LIB_FDATASYNC) -o emacsclient hexl${EXEEXT}: ${srcdir}/hexl.c $(config_h) $(CC) ${ALL_CFLAGS} ${srcdir}/hexl.c $(LOADLIBES) -o hexl === modified file 'lib-src/emacsclient.c' --- lib-src/emacsclient.c 2013-01-02 16:13:04 +0000 +++ lib-src/emacsclient.c 2013-03-13 18:42:22 +0000 @@ -1724,7 +1724,8 @@ needlf = 2; } fflush (stdout); - fsync (1); + while (fdatasync (1) != 0 && errno == EINTR) + continue; /* Now, wait for an answer and print any messages. */ while (exit_status == EXIT_SUCCESS) @@ -1825,7 +1826,8 @@ if (needlf) printf ("\n"); fflush (stdout); - fsync (1); + while (fdatasync (1) != 0 && errno == EINTR) + continue; if (rl < 0) exit_status = EXIT_FAILURE; === modified file 'lib-src/movemail.c' --- lib-src/movemail.c 2013-03-13 01:05:40 +0000 +++ lib-src/movemail.c 2013-03-13 18:42:22 +0000 @@ -466,10 +466,8 @@ } } -#ifdef BSD_SYSTEM - if (fsync (outdesc) < 0) + if (fsync (outdesc) != 0 && errno != EINVAL) pfatal_and_delete (outname); -#endif /* Prevent symlink attacks truncating other users' mailboxes */ if (setregid (-1, real_gid) < 0) @@ -750,21 +748,14 @@ } } - /* On AFS, a call to write only modifies the file in the local - * workstation's AFS cache. The changes are not written to the server - * until a call to fsync or close is made. Users with AFS home - * directories have lost mail when over quota because these checks were - * not made in previous versions of movemail. */ - -#ifdef BSD_SYSTEM - if (fsync (mbfi) < 0) + if (fsync (mbfi) != 0 && errno != EINVAL) { error ("Error in fsync: %s", strerror (errno), 0); + close (mbfi); return EXIT_FAILURE; } -#endif - if (close (mbfi) == -1) + if (close (mbfi) != 0) { error ("Error in close: %s", strerror (errno), 0); return EXIT_FAILURE; === added file 'lib/fdatasync.c' --- lib/fdatasync.c 1970-01-01 00:00:00 +0000 +++ lib/fdatasync.c 2013-03-13 18:42:22 +0000 @@ -0,0 +1,27 @@ +/* Emulate fdatasync on platforms that lack it. + + Copyright (C) 2011-2013 Free Software Foundation, Inc. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public + License as published by the Free Software Foundation; either + version 3 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +#include +#include + +int +fdatasync (int fd) +{ + /* This does more work than strictly necessary, but is the best we + can do portably. */ + return fsync (fd); +} === added file 'lib/fsync.c' --- lib/fsync.c 1970-01-01 00:00:00 +0000 +++ lib/fsync.c 2013-03-13 18:42:22 +0000 @@ -0,0 +1,83 @@ +/* Emulate fsync on platforms that lack it, primarily Windows and + cross-compilers like MinGW. + + This is derived from sqlite3 sources. + http://www.sqlite.org/cvstrac/rlog?f=sqlite/src/os_win.c + http://www.sqlite.org/copyright.html + + Written by Richard W.M. Jones + + Copyright (C) 2008-2013 Free Software Foundation, Inc. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public + License as published by the Free Software Foundation; either + version 3 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +#include +#include + +#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ + +/* FlushFileBuffers */ +# define WIN32_LEAN_AND_MEAN +# include + +# include + +/* Get _get_osfhandle. */ +# include "msvc-nothrow.h" + +int +fsync (int fd) +{ + HANDLE h = (HANDLE) _get_osfhandle (fd); + DWORD err; + + if (h == INVALID_HANDLE_VALUE) + { + errno = EBADF; + return -1; + } + + if (!FlushFileBuffers (h)) + { + /* Translate some Windows errors into rough approximations of Unix + * errors. MSDN is useless as usual - in this case it doesn't + * document the full range of errors. + */ + err = GetLastError (); + switch (err) + { + case ERROR_ACCESS_DENIED: + /* For a read-only handle, fsync should succeed, even though we have + no way to sync the access-time changes. */ + return 0; + + /* eg. Trying to fsync a tty. */ + case ERROR_INVALID_HANDLE: + errno = EINVAL; + break; + + default: + errno = EIO; + } + return -1; + } + + return 0; +} + +#else /* !Windows */ + +# error "This platform lacks fsync function, and Gnulib doesn't provide a replacement. This is a bug in Gnulib." + +#endif /* !Windows */ === modified file 'lib/gnulib.mk' --- lib/gnulib.mk 2013-02-11 23:37:18 +0000 +++ lib/gnulib.mk 2013-03-13 18:42:22 +0000 @@ -21,7 +21,7 @@ # the same distribution terms as the rest of that program. # # Generated by gnulib-tool. -# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --avoid=dup --avoid=errno --avoid=fchdir --avoid=fcntl --avoid=fstat --avoid=malloc-posix --avoid=msvc-inval --avoid=msvc-nothrow --avoid=open --avoid=openat-die --avoid=opendir --avoid=raise --avoid=save-cwd --avoid=select --avoid=sigprocmask --avoid=sys_types --avoid=threadlib --makefile-name=gnulib.mk --conditional-dependencies --no-libtool --macro-prefix=gl --no-vc-files alloca-opt c-ctype c-strcase careadlinkat close-stream crypto/md5 crypto/sha1 crypto/sha256 crypto/sha512 dtoastr dtotimespec dup2 environ execinfo faccessat fcntl-h fdopendir filemode fstatat getloadavg getopt-gnu gettime gettimeofday ignore-value intprops largefile lstat manywarnings memrchr mktime pselect pthread_sigmask putenv readlink readlinkat sig2str socklen stat-time stdalign stdarg stdbool stdio strftime strtoimax strtoumax symlink sys_stat sys_time time timer-time timespec-add timespec-sub unsetenv utimens warnings +# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --avoid=dup --avoid=errno --avoid=fchdir --avoid=fcntl --avoid=fstat --avoid=malloc-posix --avoid=msvc-inval --avoid=msvc-nothrow --avoid=open --avoid=openat-die --avoid=opendir --avoid=raise --avoid=save-cwd --avoid=select --avoid=sigprocmask --avoid=sys_types --avoid=threadlib --makefile-name=gnulib.mk --conditional-dependencies --no-libtool --macro-prefix=gl --no-vc-files alloca-opt c-ctype c-strcase careadlinkat close-stream crypto/md5 crypto/sha1 crypto/sha256 crypto/sha512 dtoastr dtotimespec dup2 environ execinfo faccessat fcntl-h fdatasync fdopendir filemode fstatat fsync getloadavg getopt-gnu gettime gettimeofday ignore-value intprops largefile lstat manywarnings memrchr mktime pselect pthread_sigmask putenv readlink readlinkat sig2str socklen stat-time stdalign stdarg stdbool stdio strftime strtoimax strtoumax symlink sys_stat sys_time time timer-time timespec-add timespec-sub unsetenv utimens warnings MOSTLYCLEANFILES += core *.stackdump @@ -297,6 +297,15 @@ ## end gnulib module fcntl-h +## begin gnulib module fdatasync + + +EXTRA_DIST += fdatasync.c + +EXTRA_libgnu_a_SOURCES += fdatasync.c + +## end gnulib module fdatasync + ## begin gnulib module fdopendir @@ -332,6 +341,15 @@ ## end gnulib module fstatat +## begin gnulib module fsync + + +EXTRA_DIST += fsync.c + +EXTRA_libgnu_a_SOURCES += fsync.c + +## end gnulib module fsync + ## begin gnulib module getgroups if gl_GNULIB_ENABLED_getgroups === added file 'm4/fdatasync.m4' --- m4/fdatasync.m4 1970-01-01 00:00:00 +0000 +++ m4/fdatasync.m4 2013-03-13 18:42:22 +0000 @@ -0,0 +1,32 @@ +# fdatasync.m4 serial 4 +dnl Copyright (C) 2008-2013 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_FUNC_FDATASYNC], +[ + AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) + + dnl Using AC_CHECK_FUNCS_ONCE would break our subsequent AC_SEARCH_LIBS + AC_CHECK_DECLS_ONCE([fdatasync]) + LIB_FDATASYNC= + AC_SUBST([LIB_FDATASYNC]) + + if test $ac_cv_have_decl_fdatasync = no; then + HAVE_DECL_FDATASYNC=0 + dnl Mac OS X 10.7 has fdatasync but does not declare it. + AC_CHECK_FUNCS([fdatasync]) + if test $ac_cv_func_fdatasync = no; then + HAVE_FDATASYNC=0 + fi + else + dnl Solaris <= 2.6 has fdatasync() in libposix4. + dnl Solaris 7..10 has it in librt. + gl_saved_libs=$LIBS + AC_SEARCH_LIBS([fdatasync], [rt posix4], + [test "$ac_cv_search_fdatasync" = "none required" || + LIB_FDATASYNC=$ac_cv_search_fdatasync]) + LIBS=$gl_saved_libs + fi +]) === added file 'm4/fsync.m4' --- m4/fsync.m4 1970-01-01 00:00:00 +0000 +++ m4/fsync.m4 2013-03-13 18:42:22 +0000 @@ -0,0 +1,17 @@ +# fsync.m4 serial 2 +dnl Copyright (C) 2008-2013 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_FUNC_FSYNC], +[ + AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) + AC_CHECK_FUNCS_ONCE([fsync]) + if test $ac_cv_func_fsync = no; then + HAVE_FSYNC=0 + fi +]) + +# Prerequisites of lib/fsync.c. +AC_DEFUN([gl_PREREQ_FSYNC], [:]) === modified file 'm4/gnulib-comp.m4' --- m4/gnulib-comp.m4 2013-03-01 15:16:43 +0000 +++ m4/gnulib-comp.m4 2013-03-13 18:42:22 +0000 @@ -63,10 +63,12 @@ # Code from module extern-inline: # Code from module faccessat: # Code from module fcntl-h: + # Code from module fdatasync: # Code from module fdopendir: # Code from module filemode: # Code from module fpending: # Code from module fstatat: + # Code from module fsync: # Code from module getgroups: # Code from module getloadavg: # Code from module getopt-gnu: @@ -187,6 +189,11 @@ gl_MODULE_INDICATOR([faccessat]) gl_UNISTD_MODULE_INDICATOR([faccessat]) gl_FCNTL_H + gl_FUNC_FDATASYNC + if test $HAVE_FDATASYNC = 0; then + AC_LIBOBJ([fdatasync]) + fi + gl_UNISTD_MODULE_INDICATOR([fdatasync]) gl_FUNC_FDOPENDIR if test $HAVE_FDOPENDIR = 0 || test $REPLACE_FDOPENDIR = 1; then AC_LIBOBJ([fdopendir]) @@ -204,6 +211,12 @@ AC_LIBOBJ([fstatat]) fi gl_SYS_STAT_MODULE_INDICATOR([fstatat]) + gl_FUNC_FSYNC + if test $HAVE_FSYNC = 0; then + AC_LIBOBJ([fsync]) + gl_PREREQ_FSYNC + fi + gl_UNISTD_MODULE_INDICATOR([fsync]) gl_GETLOADAVG if test $HAVE_GETLOADAVG = 0; then AC_LIBOBJ([getloadavg]) @@ -743,12 +756,14 @@ lib/execinfo.in.h lib/faccessat.c lib/fcntl.in.h + lib/fdatasync.c lib/fdopendir.c lib/filemode.c lib/filemode.h lib/fpending.c lib/fpending.h lib/fstatat.c + lib/fsync.c lib/ftoastr.c lib/ftoastr.h lib/getgroups.c @@ -842,10 +857,12 @@ m4/faccessat.m4 m4/fcntl-o.m4 m4/fcntl_h.m4 + m4/fdatasync.m4 m4/fdopendir.m4 m4/filemode.m4 m4/fpending.m4 m4/fstatat.m4 + m4/fsync.m4 m4/getgroups.m4 m4/getloadavg.m4 m4/getopt.m4 === modified file 'nt/ChangeLog' --- nt/ChangeLog 2013-03-11 16:31:55 +0000 +++ nt/ChangeLog 2013-03-13 18:42:22 +0000 @@ -1,3 +1,8 @@ +2013-03-13 Paul Eggert + + File synchronization fixes (Bug#13944). + * inc/ms-w32.h (fdatasync): New macro, suggested by Eli Zaretskii. + 2013-03-05 Paul Eggert FILE's lock is now always .#FILE and may be a regular file (Bug#13807). === modified file 'nt/inc/ms-w32.h' --- nt/inc/ms-w32.h 2013-02-25 17:36:03 +0000 +++ nt/inc/ms-w32.h 2013-03-13 18:42:22 +0000 @@ -220,6 +220,7 @@ /* Map to MSVC names. */ #define execlp _execlp #define execvp _execvp +#define fdatasync _commit #define fdopen _fdopen #ifndef fileno #define fileno _fileno === modified file 'src/ChangeLog' --- src/ChangeLog 2013-03-13 17:31:06 +0000 +++ src/ChangeLog 2013-03-13 18:42:22 +0000 @@ -1,3 +1,14 @@ +2013-03-13 Paul Eggert + + File synchronization fixes (Bug#13944). + * Makefile.in (LIB_FDATASYNC): New macro. + (LIBES): Use it. + * conf_post.h (BSD_SYSTEM, BSD_SYSTEM_AHB): Remove; no longer needed. + * 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. + 2013-03-13 Eli Zaretskii * w32term.c (w32_read_socket): If we Emacs frame is being === modified file 'src/Makefile.in' --- src/Makefile.in 2013-02-25 05:55:37 +0000 +++ src/Makefile.in 2013-03-13 18:42:22 +0000 @@ -139,6 +139,7 @@ LIB_CLOCK_GETTIME=@LIB_CLOCK_GETTIME@ LIB_EACCESS=@LIB_EACCESS@ +LIB_FDATASYNC=@LIB_FDATASYNC@ LIB_TIMER_TIME=@LIB_TIMER_TIME@ DBUS_CFLAGS = @DBUS_CFLAGS@ @@ -391,7 +392,7 @@ LIBES = $(LIBS) $(W32_LIBS) $(LIBS_GNUSTEP) $(LIBX_BASE) $(LIBIMAGE) \ $(LIBX_OTHER) $(LIBSOUND) \ $(RSVG_LIBS) $(IMAGEMAGICK_LIBS) $(LIB_CLOCK_GETTIME) \ - $(LIB_EACCESS) $(LIB_TIMER_TIME) $(DBUS_LIBS) \ + $(LIB_EACCESS) $(LIB_FDATASYNC) $(LIB_TIMER_TIME) $(DBUS_LIBS) \ $(LIB_EXECINFO) \ $(LIBXML2_LIBS) $(LIBGPM) $(LIBRESOLV) $(LIBS_SYSTEM) \ $(LIBS_TERMCAP) $(GETLOADAVG_LIBS) $(SETTINGS_LIBS) $(LIBSELINUX_LIBS) \ === modified file 'src/conf_post.h' --- src/conf_post.h 2013-02-01 06:30:51 +0000 +++ src/conf_post.h 2013-03-13 18:42:22 +0000 @@ -44,19 +44,6 @@ # define __has_attribute(a) 0 /* non-clang */ #endif -/* This silences a few compilation warnings on FreeBSD. */ -#ifdef BSD_SYSTEM_AHB -#undef BSD_SYSTEM_AHB -#undef BSD_SYSTEM -#if __FreeBSD__ == 1 -#define BSD_SYSTEM 199103 -#elif __FreeBSD__ == 2 -#define BSD_SYSTEM 199306 -#elif __FreeBSD__ >= 3 -#define BSD_SYSTEM 199506 -#endif -#endif - #ifdef DARWIN_OS #ifdef emacs #define malloc unexec_malloc === modified file 'src/fileio.c' --- src/fileio.c 2013-03-13 07:27:34 +0000 +++ src/fileio.c 2013-03-13 18:42:22 +0000 @@ -4959,20 +4959,23 @@ immediate_quit = 0; -#ifdef HAVE_FSYNC /* fsync appears to change the modtime on BSD4.2. Disk full in NFS may be reported here. */ /* mib says that closing the file will try to write as fast as NFS can do it, and that means the fsync here is not crucial for autosave files. */ - if (!auto_saving && !write_region_inhibit_fsync && fsync (desc) < 0) + if (!auto_saving && !write_region_inhibit_fsync) { - /* If fsync fails with EINTR, don't treat that as serious. Also + /* Transfer data and metadata to disk, retrying if interrupted. Also, ignore EINVAL which happens when fsync is not supported on this file. */ - if (errno != EINTR && errno != EINVAL) - ok = 0, save_errno = errno; + while (fsync (desc) != 0) + if (errno != EINTR) + { + if (errno != EINVAL) + ok = 0, save_errno = errno; + break; + } } -#endif modtime = invalid_emacs_time (); if (visiting) @@ -6046,13 +6049,11 @@ file is usually more useful if it contains the deleted text. */); Vauto_save_include_big_deletions = Qnil; -#ifdef HAVE_FSYNC DEFVAR_BOOL ("write-region-inhibit-fsync", write_region_inhibit_fsync, doc: /* Non-nil means don't call fsync in `write-region'. This variable affects calls to `write-region' as well as save commands. A non-nil value may result in data loss! */); write_region_inhibit_fsync = 0; -#endif DEFVAR_BOOL ("delete-by-moving-to-trash", delete_by_moving_to_trash, doc: /* Specifies whether to use the system's trash can. === modified file 'src/filelock.c' --- src/filelock.c 2013-03-05 22:35:41 +0000 +++ src/filelock.c 2013-03-13 18:42:22 +0000 @@ -437,6 +437,14 @@ if (emacs_write (fd, lock_info_str, lock_info_len) != lock_info_len || (need_fchmod && fchmod (fd, world_readable) != 0)) err = errno; + else + while (fsync (fd) != 0) + if (errno != EINTR) + { + if (errno != EINVAL) + err = errno; + break; + } if (emacs_close (fd) != 0) err = errno; if (!err && rename_lock_file (nonce, lfname, force) != 0) === modified file 'src/sysdep.c' --- src/sysdep.c 2013-03-13 05:04:46 +0000 +++ src/sysdep.c 2013-03-13 18:42:22 +0000 @@ -1289,10 +1289,9 @@ if (tty_out->terminal->reset_terminal_modes_hook) tty_out->terminal->reset_terminal_modes_hook (tty_out->terminal); -#ifdef BSD_SYSTEM /* Avoid possible loss of output when changing terminal modes. */ - fsync (fileno (tty_out->output)); -#endif + while (fdatasync (fileno (tty_out->output)) != 0 && errno == EINTR) + continue; #ifndef DOS_NT #ifdef F_SETOWN ------------------------------------------------------------ revno: 112038 fixes bug: http://debbugs.gnu.org/13937 committer: Eli Zaretskii branch nick: trunk timestamp: Wed 2013-03-13 19:31:06 +0200 message: Fix bug #13937 with creating a maximized frame on MS-Windows. src/w32term.c (w32_read_socket): If we Emacs frame is being activated, call w32fullscreen_hook, to make sure the new frame dimensions are in effect. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2013-03-13 15:41:54 +0000 +++ src/ChangeLog 2013-03-13 17:31:06 +0000 @@ -1,3 +1,9 @@ +2013-03-13 Eli Zaretskii + + * w32term.c (w32_read_socket): If we Emacs frame is being + activated, call w32fullscreen_hook, to make sure the new frame + dimensions are in effect. (Bug#13937) + 2013-03-13 Dmitry Antipov * xdisp.c (init_iterator): Simplify because both character and byte === modified file 'src/w32term.c' --- src/w32term.c 2013-03-10 22:55:25 +0000 +++ src/w32term.c 2013-03-13 17:31:06 +0000 @@ -236,6 +236,7 @@ #endif static void my_set_foreground_window (HWND); static void my_destroy_window (struct frame *, HWND); +static void w32fullscreen_hook (FRAME_PTR); #ifdef GLYPH_DEBUG static void x_check_font (struct frame *, struct font *); @@ -4717,7 +4718,16 @@ case WM_ACTIVATEAPP: f = x_window_to_frame (dpyinfo, msg.msg.hwnd); if (f) - x_check_fullscreen (f); + { + /* If we are being activated, run the full-screen hook + function, to actually install the required size in + effect. This is because when the hook is run from + x_set_fullscreen, the frame might not yet be visible, + if that call is a result of make-frame. */ + if (msg.msg.wParam) + w32fullscreen_hook (f); + x_check_fullscreen (f); + } check_visibility = 1; break; ------------------------------------------------------------ revno: 112037 committer: Dmitry Antipov branch nick: trunk timestamp: Wed 2013-03-13 19:41:54 +0400 message: * window.c (Fscroll_other_window): Use SET_PT_BOTH because both character and byte positions can be obtained from marker. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2013-03-13 15:21:46 +0000 +++ src/ChangeLog 2013-03-13 15:41:54 +0000 @@ -2,6 +2,8 @@ * xdisp.c (init_iterator): Simplify because both character and byte positions are either specified or -1. Add eassert. Adjust comment. + * window.c (Fscroll_other_window): Use SET_PT_BOTH because both + character and byte positions can be obtained from marker. 2013-03-13 Paul Eggert === modified file 'src/window.c' --- src/window.c 2013-03-07 04:42:59 +0000 +++ src/window.c 2013-03-13 15:41:54 +0000 @@ -5021,7 +5021,7 @@ ++windows_or_buffers_changed; Fset_buffer (w->buffer); - SET_PT (marker_position (w->pointm)); + SET_PT_BOTH (marker_position (w->pointm), marker_byte_position (w->pointm)); if (NILP (arg)) window_scroll (window, 1, 1, 1); ------------------------------------------------------------ revno: 112036 committer: Dmitry Antipov branch nick: trunk timestamp: Wed 2013-03-13 19:21:46 +0400 message: * xdisp.c (init_iterator): Simplify because both character and byte positions are either specified or -1. Add eassert. Adjust comment. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2013-03-13 07:27:34 +0000 +++ src/ChangeLog 2013-03-13 15:21:46 +0000 @@ -1,3 +1,8 @@ +2013-03-13 Dmitry Antipov + + * xdisp.c (init_iterator): Simplify because both character and byte + positions are either specified or -1. Add eassert. Adjust comment. + 2013-03-13 Paul Eggert Static checking by Sun C 5.12. === modified file 'src/xdisp.c' --- src/xdisp.c 2013-03-10 17:28:04 +0000 +++ src/xdisp.c 2013-03-13 15:21:46 +0000 @@ -2550,7 +2550,7 @@ at character position CHARPOS. CHARPOS < 0 means that no buffer position is specified which is useful when the iterator is assigned a position later. BYTEPOS is the byte position corresponding to - CHARPOS. BYTEPOS < 0 means compute it from CHARPOS. + CHARPOS. If ROW is not null, calls to produce_glyphs with IT as parameter will produce glyphs in that row. @@ -2828,18 +2828,14 @@ if (charpos >= BUF_BEG (current_buffer)) { it->end_charpos = ZV; + eassert (charpos == BYTE_TO_CHAR (bytepos)); IT_CHARPOS (*it) = charpos; + IT_BYTEPOS (*it) = bytepos; /* We will rely on `reseat' to set this up properly, via handle_face_prop. */ it->face_id = it->base_face_id; - /* Compute byte position if not specified. */ - if (bytepos < charpos) - IT_BYTEPOS (*it) = CHAR_TO_BYTE (charpos); - else - IT_BYTEPOS (*it) = bytepos; - it->start = it->current; /* Do we need to reorder bidirectional text? Not if this is a unibyte buffer: by definition, none of the single-byte ------------------------------------------------------------ revno: 112035 committer: Michael Albinus + + * net/tramp-sh.el (tramp-sh-handle-insert-directory): Check, + whether `default-file-name-coding-system' is bound. It isn't in + XEmacs. + 2013-03-13 Stefan Monnier * emacs-lisp/byte-run.el (defun-declarations-alist): Don't use @@ -195,14 +201,13 @@ (tramp-gvfs-mount-spec): Use it. (tramp-gvfs-maybe-open-connection): Check, that in case of "smb" there is a share name. Handle different names of the D-Bus - signals and methods. - (tramp-gvfs-maybe-open-connection): Set connection properties - needed for `tramp-check-cached-permissions'. + signals and methods. Set connection properties needed for + `tramp-check-cached-permissions'. (tramp-gvfs-send-command): Apply `tramp-gvfs-maybe-open-connection'. Return t or nil. * net/tramp.el (tramp-backtrace): Move up. - (tramp-error): Apply a backtrace into the debug buffer when + (tramp-error): Dump a backtrace into the debug buffer when `tramp-verbose > 9. (tramp-file-mode-type-map, tramp-file-mode-from-int) (tramp-file-mode-permissions, tramp-get-local-uid) === modified file 'lisp/net/tramp-sh.el' --- lisp/net/tramp-sh.el 2013-03-09 11:06:23 +0000 +++ lisp/net/tramp-sh.el 2013-03-13 11:38:13 +0000 @@ -2568,7 +2568,9 @@ ;; Decode the output, it could be multibyte. (decode-coding-region beg (point-max) - (or file-name-coding-system default-file-name-coding-system)) + (or file-name-coding-system + (and (boundp 'default-file-name-coding-system) + (symbolp 'default-file-name-coding-system)))) ;; The inserted file could be from somewhere else. (when (and (not wildcard) (not full-directory-p)) ------------------------------------------------------------ revno: 112033 committer: Glenn Morris branch nick: trunk timestamp: Wed 2013-03-13 06:17:36 -0400 message: Auto-commit of generated files. diff: === modified file 'autogen/config.in' --- autogen/config.in 2013-03-02 11:17:34 +0000 +++ autogen/config.in 2013-03-13 10:17:36 +0000 @@ -218,9 +218,6 @@ /* Define to 1 if the file /usr/lpp/X11/bin/smt.exp exists. */ #undef HAVE_AIX_SMT_EXP -/* Define to 1 if you have the `alarm' function. */ -#undef HAVE_ALARM - /* Define to 1 if you have 'alloca' after including , a header that may be supplied by this distribution. */ #undef HAVE_ALLOCA @@ -281,6 +278,10 @@ /* Define to 1 if you have the `dbus_watch_get_unix_fd' function. */ #undef HAVE_DBUS_WATCH_GET_UNIX_FD +/* Define to 1 if you have the declaration of `alarm', and to 0 if you don't. + */ +#undef HAVE_DECL_ALARM + /* Define to 1 if you have the declaration of `fdopendir', and to 0 if you don't. */ #undef HAVE_DECL_FDOPENDIR @@ -329,6 +330,10 @@ don't. */ #undef HAVE_DECL_UNSETENV +/* Define to 1 if you have the declaration of `_putenv', and to 0 if you + don't. */ +#undef HAVE_DECL__PUTENV + /* Define to 1 if you have the declaration of `__fpending', and to 0 if you don't. */ #undef HAVE_DECL___FPENDING @@ -1130,9 +1135,6 @@ /* Define to 1 if you have the `_ftime' function. */ #undef HAVE__FTIME -/* Define to 1 if you have the `_putenv' function. */ -#undef HAVE__PUTENV - /* Define to 1 if _setjmp and _longjmp work. */ #undef HAVE__SETJMP === modified file 'autogen/configure' --- autogen/configure 2013-03-08 08:04:30 +0000 +++ autogen/configure 2013-03-13 10:17:36 +0000 @@ -3349,7 +3349,6 @@ as_fn_append ac_header_list " stdint.h" as_fn_append ac_header_list " inttypes.h" as_fn_append ac_func_list " lstat" -as_fn_append ac_func_list " alarm" as_fn_append ac_header_list " sys/select.h" as_fn_append ac_func_list " pselect" as_fn_append ac_func_list " pthread_sigmask" @@ -19467,7 +19466,16 @@ REPLACE_NANOSLEEP=GNULIB_PORTCHECK; REPLACE_TIMEGM=GNULIB_PORTCHECK; +ac_fn_c_check_decl "$LINENO" "alarm" "ac_cv_have_decl_alarm" "$ac_includes_default" +if test "x$ac_cv_have_decl_alarm" = x""yes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_ALARM $ac_have_decl +_ACEOF GNULIB_PSELECT=0; @@ -22549,8 +22557,8 @@ # include #endif -#ifndef HAVE_ALARM -# define alarm(X) /* empty */ +#if HAVE_DECL_ALARM +# include #endif /* Work around redefinition to rpl_putenv by other config tests. */ @@ -22686,10 +22694,13 @@ int time_t_signed_magnitude = (time_t) ~ (time_t) 0 < (time_t) -1; int time_t_signed = ! ((time_t) 0 < (time_t) -1); +#if HAVE_DECL_ALARM /* This test makes some buggy mktime implementations loop. Give up after 60 seconds; a mktime slower than that isn't worth using anyway. */ + signal (SIGALRM, SIG_DFL); alarm (60); +#endif time_t_max = (! time_t_signed ? (time_t) -1 @@ -23267,17 +23278,17 @@ gl_LIBOBJS="$gl_LIBOBJS putenv.$ac_objext" - for ac_func in _putenv -do : - ac_fn_c_check_func "$LINENO" "_putenv" "ac_cv_func__putenv" -if test "x$ac_cv_func__putenv" = x""yes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE__PUTENV 1 + ac_fn_c_check_decl "$LINENO" "_putenv" "ac_cv_have_decl__putenv" "$ac_includes_default" +if test "x$ac_cv_have_decl__putenv" = x""yes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL__PUTENV $ac_have_decl _ACEOF -fi -done - fi ------------------------------------------------------------ revno: 112032 committer: Paul Eggert branch nick: trunk timestamp: Wed 2013-03-13 00:27:34 -0700 message: Static checking by Sun C 5.12. * lib-src/etags.c (analyse_regex): Omit unreachable code. * src/alloc.c (buffer_memory_full) [REL_ALLOC]: * src/bytecode.c (exec_byte_code): * src/dispnew.c (init_display): * src/eval.c (error): * src/fileio.c (Fsubstitute_in_file_name): * src/keyboard.c (Fevent_convert_list): * src/keymap.c (Fsingle_key_description): * src/term.c (maybe_fatal, fatal): * src/xfns.c (Fx_display_backing_store, Fx_display_visual_class): * src/xsmfns.c (Fhandle_save_session): Omit unreachable code. * src/keymap.c (map_keymap_char_table_item): Cast void * to a function pointer type; the C Standard requires this. diff: === modified file 'lib-src/ChangeLog' --- lib-src/ChangeLog 2013-03-13 01:05:40 +0000 +++ lib-src/ChangeLog 2013-03-13 07:27:34 +0000 @@ -1,5 +1,8 @@ 2013-03-13 Paul Eggert + Static checking by Sun C 5.12. + * etags.c (analyse_regex): Omit unreachable code. + * movemail.c (main): Call umask on all systems. This is OK since Emacs already assumes umask elsewhere. Don't grant more read permissions than necessary. === modified file 'lib-src/etags.c' --- lib-src/etags.c 2013-03-05 17:13:01 +0000 +++ lib-src/etags.c 2013-03-13 07:27:34 +0000 @@ -5628,10 +5628,7 @@ /* regexfile is a file containing regexps, one per line. */ regexfp = fopen (regexfile, "r"); if (regexfp == NULL) - { - pfatal (regexfile); - return; - } + pfatal (regexfile); linebuffer_init (®exbuf); while (readline_internal (®exbuf, regexfp) > 0) analyse_regex (regexbuf.buffer); === modified file 'src/ChangeLog' --- src/ChangeLog 2013-03-13 05:04:46 +0000 +++ src/ChangeLog 2013-03-13 07:27:34 +0000 @@ -1,5 +1,20 @@ 2013-03-13 Paul Eggert + Static checking by Sun C 5.12. + * alloc.c (buffer_memory_full) [REL_ALLOC]: + * bytecode.c (exec_byte_code): + * dispnew.c (init_display): + * eval.c (error): + * fileio.c (Fsubstitute_in_file_name): + * keyboard.c (Fevent_convert_list): + * keymap.c (Fsingle_key_description): + * term.c (maybe_fatal, fatal): + * xfns.c (Fx_display_backing_store, Fx_display_visual_class): + * xsmfns.c (Fhandle_save_session): + Omit unreachable code. + * keymap.c (map_keymap_char_table_item): Cast void * to + a function pointer type; the C Standard requires this. + * sysdep.c: Remove a use of BSD_SYSTEM, which I'm trying to phase out. Include unconditionally, as that works elsewhere and is simpler here. Include if DARWIN_OS || === modified file 'src/alloc.c' --- src/alloc.c 2013-02-08 05:28:52 +0000 +++ src/alloc.c 2013-03-13 07:27:34 +0000 @@ -422,11 +422,11 @@ #ifndef REL_ALLOC memory_full (nbytes); -#endif - +#else /* This used to call error, but if we've run out of memory, we could get infinite recursion trying to build the string. */ xsignal (Qnil, Vmemory_signal_data); +#endif } /* A common multiple of the positive integers A and B. Ideally this === modified file 'src/bytecode.c' --- src/bytecode.c 2013-03-10 21:46:55 +0000 +++ src/bytecode.c 2013-03-13 07:27:34 +0000 @@ -755,7 +755,6 @@ { BEFORE_POTENTIAL_GC (); wrong_type_argument (Qlistp, v1); - AFTER_POTENTIAL_GC (); } NEXT; } @@ -790,7 +789,6 @@ { BEFORE_POTENTIAL_GC (); wrong_type_argument (Qlistp, v1); - AFTER_POTENTIAL_GC (); } NEXT; } === modified file 'src/dispnew.c' --- src/dispnew.c 2013-03-10 17:28:04 +0000 +++ src/dispnew.c 2013-03-13 07:27:34 +0000 @@ -6100,10 +6100,7 @@ /* If no window system has been specified, try to use the terminal. */ if (! isatty (0)) - { - fatal ("standard input is not a tty"); - exit (1); - } + fatal ("standard input is not a tty"); #ifdef WINDOWSNT terminal_type = "w32console"; === modified file 'src/eval.c' --- src/eval.c 2013-02-25 16:05:49 +0000 +++ src/eval.c 2013-03-13 07:27:34 +0000 @@ -1690,7 +1690,6 @@ va_list ap; va_start (ap, m); verror (m, ap); - va_end (ap); } DEFUN ("commandp", Fcommandp, Scommandp, 1, 2, 0, === modified file 'src/fileio.c' --- src/fileio.c 2013-03-07 03:01:17 +0000 +++ src/fileio.c 2013-03-13 07:27:34 +0000 @@ -1850,9 +1850,6 @@ error ("Missing \"}\" in environment-variable substitution"); badvar: error ("Substituting nonexistent environment variable \"%s\"", target); - - /* NOTREACHED */ - return Qnil; } /* A slightly faster and more convenient way to get @@ -3305,7 +3302,6 @@ return Qnil; #endif report_file_error ("Setting file times", Fcons (absname, Qnil)); - return Qnil; } } === modified file 'src/keyboard.c' --- src/keyboard.c 2013-03-11 01:17:40 +0000 +++ src/keyboard.c 2013-03-13 07:27:34 +0000 @@ -6552,10 +6552,7 @@ else if (SYMBOLP (base)) return apply_modifiers (modifiers, base); else - { - error ("Invalid base event"); - return Qnil; - } + error ("Invalid base event"); } /* Try to recognize SYMBOL as a modifier name. === modified file 'src/keymap.c' --- src/keymap.c 2013-02-11 19:21:23 +0000 +++ src/keymap.c 2013-03-13 07:27:34 +0000 @@ -565,7 +565,8 @@ { if (!NILP (val)) { - map_keymap_function_t fun = XSAVE_POINTER (args, 0); + map_keymap_function_t fun + = (map_keymap_function_t) XSAVE_POINTER (args, 0); /* If the key is a range, make a copy since map_char_table modifies it in place. */ if (CONSP (key)) @@ -2310,7 +2311,6 @@ return Fcopy_sequence (key); else error ("KEY must be an integer, cons, symbol, or string"); - return Qnil; } static char * === modified file 'src/term.c' --- src/term.c 2013-03-11 01:17:40 +0000 +++ src/term.c 2013-03-13 07:27:34 +0000 @@ -3426,9 +3426,6 @@ vfatal (str2, ap); else verror (str1, ap); - - va_end (ap); - emacs_abort (); } void @@ -3437,7 +3434,6 @@ va_list ap; va_start (ap, str); vfatal (str, ap); - va_end (ap); } === modified file 'src/xfns.c' --- src/xfns.c 2013-03-10 17:28:04 +0000 +++ src/xfns.c 2013-03-13 07:27:34 +0000 @@ -3769,7 +3769,6 @@ default: error ("Strange value for BackingStore parameter of screen"); - result = Qnil; } return result; @@ -3811,7 +3810,6 @@ break; default: error ("Display has an unknown visual class"); - result = Qnil; } return result; === modified file 'src/xsmfns.c' --- src/xsmfns.c 2013-01-01 09:11:05 +0000 +++ src/xsmfns.c 2013-03-13 07:27:34 +0000 @@ -514,9 +514,11 @@ prevent. Fix this in next version. */ Fkill_emacs (Qnil); +#if 0 /* This will not be reached, but we want kill-emacs-hook to be run. */ SmcCloseConnection (smc_conn, 0, 0); ice_connection_closed (); +#endif } return Qnil; ------------------------------------------------------------ revno: 112031 committer: Paul Eggert branch nick: trunk timestamp: Wed 2013-03-13 00:15:17 -0700 message: Merge from gnulib: putenv: port to Solaris 10. diff: === modified file 'ChangeLog' --- ChangeLog 2013-03-13 00:38:42 +0000 +++ ChangeLog 2013-03-13 07:15:17 +0000 @@ -1,6 +1,7 @@ 2013-03-13 Paul Eggert Merge from gnulib, incorporating: + 2013-03-13 putenv: port to Solaris 10 2013-03-12 mktime: fix configure typo 2013-03-11 regex: port to mingw's recent addition of undeclared alarm 2013-03-11 putenv: avoid compilation warning on mingw === modified file 'lib/putenv.c' --- lib/putenv.c 2013-03-13 00:38:42 +0000 +++ lib/putenv.c 2013-03-13 07:15:17 +0000 @@ -62,7 +62,7 @@ _unsetenv (const char *name) { size_t len; -#if !HAVE__PUTENV +#if !HAVE_DECL__PUTENV char **ep; #endif @@ -74,7 +74,7 @@ len = strlen (name); -#if HAVE__PUTENV +#if HAVE_DECL__PUTENV { int putenv_result, putenv_errno; char *name_ = malloc (len + 2); @@ -127,9 +127,9 @@ return _unsetenv (string); } -#if HAVE__PUTENV +#if HAVE_DECL__PUTENV /* Rely on _putenv to allocate the new environment. If other - parts of the application use _putenv, the !HAVE__PUTENV code + parts of the application use _putenv, the !HAVE_DECL__PUTENV code would fight over who owns the environ vector, causing a crash. */ if (name_end[1]) return _putenv (string); @@ -188,7 +188,7 @@ last_environ = new_environ; environ = new_environ; } -#endif return 0; +#endif } === modified file 'm4/putenv.m4' --- m4/putenv.m4 2013-03-01 15:16:43 +0000 +++ m4/putenv.m4 2013-03-13 07:15:17 +0000 @@ -1,4 +1,4 @@ -# putenv.m4 serial 19 +# putenv.m4 serial 20 dnl Copyright (C) 2002-2013 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -52,5 +52,5 @@ # Prerequisites of lib/putenv.c. AC_DEFUN([gl_PREREQ_PUTENV], [ - AC_CHECK_FUNCS([_putenv]) + AC_CHECK_DECLS([_putenv]) ]) ------------------------------------------------------------ revno: 112030 committer: Paul Eggert branch nick: trunk timestamp: Tue 2013-03-12 22:04:46 -0700 message: * sysdep.c: Remove a use of BSD_SYSTEM, which I'm trying to phase out. Include unconditionally, as that works elsewhere and is simpler here. Include if DARWIN_OS || __FreeBSD__, not if BSD_SYSTEM, since it's needed only for Darwin and FreeBSD now. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2013-03-11 16:31:55 +0000 +++ src/ChangeLog 2013-03-13 05:04:46 +0000 @@ -1,3 +1,11 @@ +2013-03-13 Paul Eggert + + * sysdep.c: Remove a use of BSD_SYSTEM, which I'm trying to phase out. + Include unconditionally, as that works elsewhere and + is simpler here. Include if DARWIN_OS || + __FreeBSD__, not if BSD_SYSTEM, since it's needed only for Darwin + and FreeBSD now. + 2013-03-11 Paul Eggert * insdel.c (adjust_after_replace): Use bool for boolean. === modified file 'src/sysdep.c' --- src/sysdep.c 2013-03-06 08:01:47 +0000 +++ src/sysdep.c 2013-03-13 05:04:46 +0000 @@ -38,9 +38,8 @@ #include "sysselect.h" #include "blockinput.h" -#ifdef BSD_SYSTEM -#include -#include +#if defined DARWIN_OS || defined __FreeBSD__ +# include #endif #ifdef __FreeBSD__ @@ -69,9 +68,9 @@ #ifdef MSDOS /* Demacs 1.1.2 91/10/20 Manabu Higashida, MW Aug 1993 */ #include "msdos.h" -#include #endif +#include #include #include