1. 02 Feb, 2016 1 commit
    • Paul Eggert's avatar
      Build with C11 if available · b50075dd
      Paul Eggert authored
      * admin/merge-gnulib (GNULIB_MODULES): Add std-gnu11.
      * m4/std-gnu11.m4: New file, from gnulib.
      * lib/gnulib.mk, m4/gnulib-comp.m4: Regenerate.
      b50075dd
  2. 24 Jan, 2016 1 commit
    • Paul Eggert's avatar
      Merge from gnulib · 1698036a
      Paul Eggert authored
      This incorporates:
      2016-01-24 openat_proc_name: fix last '/' overwritten on OS/2 kLIBC
      2016-01-24 closedir, dirfd, opendir: port to OpenSolaris 5.10
      2016-01-15 detect utimes() correctly on OS/2 kLIBC
      2016-01-15 openat_proc_name: port to OS/2 kLIBC
      2016-01-14 stdint: check _INTPTR_T_DECLARED for intptr_t etc.
      2016-01-14 opendir, closedir, dirfd, fdopendir: port to OS/2 kLIBC
      2016-01-14 dup, dup2, fcntl: support a directory fd on OS/2 kLIBC
      2016-01-14 binary-io: don't put fd in binary mode if a console on EMX
      2016-01-14 sig2str: list all signals on FreeBSD >= 7
      2016-01-13 acl-permissions: port to USE_ACL==0 platforms
      2016-01-12 mktime: rename macro to avoid glibc clash
      2016-01-12 Port "$@" to OpenIndiana ksh93
      2016-01-12 Port Universal Time settings to strict POSIX
      * build-aux/gitlog-to-changelog, build-aux/update-copyright:
      * doc/misc/texinfo.tex, lib/acl-internal.c, lib/acl-internal.h:
      * lib/binary-io.h, lib/dirent.in.h, lib/dirfd.c, lib/dup2.c:
      * lib/fcntl.c, lib/fdopendir.c, lib/mktime.c, lib/openat-proc.c:
      * lib/sig2str.h, lib/stdint.in.h, m4/dirfd.m4, m4/dup2.m4:
      * m4/fcntl.m4, m4/utimes.m4:
      Copy from gnulib.
      * m4/gnulib-comp.m4: Regenerate.
      1698036a
  3. 19 Jan, 2016 2 commits
    • Paul Eggert's avatar
      Avoid stdio in SIGINT handler · 564c84f4
      Paul Eggert authored
      * admin/merge-gnulib (GNULIB_MODULES): Add ignore-value.
      * lib/gnulib.mk, m4/gnulib-comp.m4: Regenerate.
      * lib/ignore-value.h: New file, from gnulib.
      * src/keyboard.c: Include it.
      (write_stdout, read_stdin): New functions.
      (handle_interrupt): Use them instead of printf and getchar,
      and avoid fflush when handling signals.
      564c84f4
    • Paul Eggert's avatar
      Merge from gnulib · cd19641e
      Paul Eggert authored
      This mostly just updates copyright dates of gnulib files.
      It also updates to the latest version of texinfo.tex.
      cd19641e
  4. 03 Jan, 2016 1 commit
    • Paul Eggert's avatar
      Avoid stdio in SIGINT handler · e79b06e6
      Paul Eggert authored
      * admin/merge-gnulib (GNULIB_MODULES): Add ignore-value.
      * lib/gnulib.mk, m4/gnulib-comp.m4: Regenerate.
      * lib/ignore-value.h: New file, from gnulib.
      * src/keyboard.c: Include it.
      (write_stdout, read_stdin): New functions.
      (handle_interrupt): Use them instead of printf and getchar,
      and avoid fflush when handling signals.
      e79b06e6
  5. 01 Jan, 2016 1 commit
    • Paul Eggert's avatar
      Merge from gnulib · 98253051
      Paul Eggert authored
      This mostly just updates copyright dates of gnulib files.
      It also updates to the latest version of texinfo.tex.
      98253051
  6. 14 Oct, 2015 1 commit
    • Paul Eggert's avatar
      Merge from gnulib · e668176e
      Paul Eggert authored
      This incorporates:
      2015-10-13 binary-io, u64, unistd: port to strict C
      2015-09-26 c-ctype: do not worry about EBCDIC + char signed
      2015-09-25 c-ctype: port better to z/OS EBCDIC
      2015-09-25 gnulib-common.m4: fix gl_PROG_AR_RANLIB/AM_PROG_AR clash
      * doc/misc/texinfo.tex, lib/binary-io.c, lib/c-ctype.h, lib/u64.c:
      * lib/unistd.c, m4/gnulib-common.m4, m4/gnulib-comp.m4:
      Copy from gnulib.
      e668176e
  7. 27 Jul, 2015 1 commit
    • Paul Eggert's avatar
      Merge from gnulib · 2856b1dd
      Paul Eggert authored
      This incorporates:
      2015-07-27 time_rz: port better to MinGW
      2015-07-27 time: port __need_time_t to MinGW
      * lib/gnulib.mk, m4/gnulib-comp.m4: Regenerate.
      * lib/strftime.c, lib/time.in.h, lib/time_rz.c: Copy from gnulib.
      * lib/time-internal.h: New file, from gnulib.
      2856b1dd
  8. 26 Jul, 2015 1 commit
    • Paul Eggert's avatar
      New optional ZONE arg for format-time-string etc. · af32fa95
      Paul Eggert authored
      This simplifies time conversions in other time zones.
      It also prevents display-time-world tampering with TZ (Bug#21020).
      * admin/admin.el (add-release-logs):
      Use improved add-log-time-format API.
      * admin/merge-gnulib (GNULIB_MODULES): Add time_rz, timegm.
      (GNULIB_TOOL_FLAGS): Avoid flexmember, setenv, unsetenv.
      * configure.ac (tzalloc): Remove test for this, since
      Emacs no longer uses HAVE_TZALLOC directly.
      * doc/lispref/os.texi (Time of Day, Time Conversion)
      (Time Parsing):
      * etc/NEWS: Document the new behavior.
      Merge from gnulib, incorporating:
      2015-07-25 strftime: fix newly-introduced bug on Solaris
      2015-07-23 fprintftime, strftime: use timezone_t args
      * lib/gnulib.mk, m4/gnulib-comp.m4: Regenerate.
      * lib/strftime.c, lib/strftime.h, lib/time.in.h, m4/sys_time_h.m4:
      * m4/time_h.m4:
      Update from gnulib.
      * lib/time_rz.c, lib/timegm.c, m4/time_rz.m4, m4/timegm.m4:
      New files from gnulib.
      * lisp/time-stamp.el (time-stamp-string):
      * lisp/time.el (display-time-world-list)
      (display-time-world-display):
      Use new API, with time zone arg.
      * lisp/time.el (display-time-world-display):
      Fix race when current-time advances while we're running.
      * lisp/vc/add-log.el (add-log-iso8601-time-zone)
      (add-log-iso8601-time-string): Accept optional time zone arg.
      * lisp/vc/add-log.el (add-change-log-entry):
      * lisp/vc/log-edit.el (log-edit-changelog-ours-p): Use new arg.
      * nt/gnulib.mk: Propagate lib/gnulib.mk changes here.
      Add rules for the time module, since they're now needed
      for tzalloc etc.
      * src/conf_post.h (getenv_TZ, setenv_TZ): New macros.
      (emacs_getenv_TZ, emacs_setenv_TZ): New decls.
      * src/editfns.c: Include errno.h.
      (set_time_zone_rule): Omit unnecessary forward decl.
      (initial_tz): Remove, replacing with ...
      (local_tz, wall_clock_tz, utc_tz): New static vars and constants.
      (tzeqlen): New constant; prefer it to (sizeof "TZ=" - 1).
      (emacs_localtime_rz, emacs_mktime_z, xtzalloc, xtzfree)
      (tzlookup): New static functions.
      (init_editfns): New arg DUMPING.  All uses changed.
      (init_editfns): Omit most initialization if dumping, not if
      !initialized.  Initialize wall_clock_tz and local_tz.
      (emacs_nmemftime, format_time_string): Time zone argument can now
      be any time zone, not just a boolean for UTC or local time.  All
      callers changed.
      (Fformat_time_string, Fencode_time, Fcurrent_time_string)
      (Fcurrent_time_zone): New optional arg ZONE.
      (Fdecode_time, Fset_time_zone_rule): ZONE arg can now also take
      the same form as with the other new additions.
      (decode_time_zone): Remove; no longer needed.
      (tzvalbuf): Now file-scope.
      (emacs_getenv_TZ, emacs_setenv_TZ): New functions.
      (syms_of_editfns): Define Qwall.
      * src/editfns.c (mktime_z) [!HAVE_TZALLOC]:
      * src/systime.h (mktime_z, timezone_t, tzalloc, tzfree)
      [!HAVE_TZALLOC]:
      Remove; now supplied by gnulib.
      * src/emacs.c (main):
      * src/lisp.h (init_editfns): Adjust to init_editfns API change.
      af32fa95
  9. 28 May, 2015 1 commit
    • Paul Eggert's avatar
      Merge from gnulib · 6c52e9b9
      Paul Eggert authored
      This incorporates:
      2015-05-27 qacl: Reimplement qset_acl and qcopy_acl (Bug#20666)
      2015-05-27 file-has-acl: Split feature tests again (Bug#20667)
      2015-05-27 string: fix build failure on BSD/OSX with FORTIFY_SOURCE
      2015-05-26 stdio: limit __gnu_printf__ witness to gcc 4.4+
      2015-05-26 inttypes: force correct mingw PRIdMAX even without <stdio.h>
      2015-05-26 stdio: fix probe on mingw under gcc 5.1
      * admin/merge-gnulib (GNULIB_MODULES):
      Replace qacl with qcopy-acl, since we don't need the rest of qacl.
      * doc/misc/texinfo.tex, lib/acl-internal.c, lib/acl-internal.h:
      * lib/inttypes.in.h, lib/qcopy-acl.c, lib/qset-acl.c:
      * lib/string.in.h, m4/acl.m4, m4/stdio_h.m4:
      Get latest versions from gnulib.
      * lib/get-permissions.c, lib/set-permissions.c: New files.
      * lib/gnulib.mk, m4/gnulib-comp.m4:
      Regenerate.
      * nt/gnulib.mk: Merge lib/gnulib.mk changes by hand.
      6c52e9b9
  10. 25 Apr, 2015 1 commit
    • Paul Eggert's avatar
      Merge from gnulib · 27e6afeb
      Paul Eggert authored
      This incorporates:
      2015-04-24 file-has-acl: new module, split from acl
      2015-04-24 manywarnings: add GCC 5.1 warnings
      2015-04-21 lstat: fix cross-compilation 'ln -s' problem
      2015-04-15 qacl: Simplify HP-UX acl_nontrivial check
      2015-04-15 acl: On Linux, check for acls without libacl
      2015-04-14 tempname: avoid unused parameter warnings (trivial)
      * lib/acl-internal.c: New file, from gnulib.
      * lib/file-has-acl.c: Remove; no longer imported from gnulib.
      * lib/acl-internal.h, lib/gnulib.mk, lib/qcopy-acl.c, lib/tempname.c:
      * m4/acl.m4, m4/gnulib-comp.m4, m4/lstat.m4, m4/manywarnings.m4:
      Update from gnulib.
      27e6afeb
  11. 07 Apr, 2015 1 commit
    • Paul Eggert's avatar
      Generate a ChangeLog file from commit logs · 23468561
      Paul Eggert authored
      * .gitignore: Add 'ChangeLog'.
      * build-aux/gitlog-to-changelog: New file, from Gnulib.
      * build-aux/gitlog-to-emacslog: New file.
      * CONTRIBUTE: Document the revised workflow.
      * Makefile.in (clean): Remove *.tmp and etc/*.tmp*
      instead of just special cases.
      (CHANGELOG_HISTORY_INDEX_MAX, CHANGELOG_N, gen_origin): New vars.
      (ChangeLog, unchanged-history-files, change-history)
      (change-history-commit): New rules.
      * admin/admin.el (make-manuals-dist--1):
      Don't worry about doc/ChangeLog.
      * admin/authors.el: Add a FIXME.
      * admin/make-tarball.txt:
      * lisp/calendar/icalendar.el:
      * lisp/gnus/deuglify.el:
      * lisp/obsolete/gulp.el:
      * lwlib/README:
      Adjust to renamed ChangeLog history files.
      * admin/merge-gnulib (GNULIB_MODULES): Add gitlog-to-changelog.
      * admin/notes/repo: Call it 'master' a la Git, not 'trunk' a la Bzr.
      Remove obsolete discussion of merging ChangeLog files.
      New section "Maintaining ChangeLog history".
      * build-aux/git-hooks/pre-commit:
      Reject attempts to commit files named 'ChangeLog'.
      * lib/gnulib.mk, m4/gnulib-comp.m4: Regenerate.
      * make-dist: Make and distribute top-level ChangeLog if there's a
      .git directory.  Distribute the new ChangeLog history files
      instead of scattered ChangeLog files.  Distribute the new files
      gitlog-to-changelog and gitlog-to-emacslog.
      Fixes: bug#19113
      23468561
  12. 19 Mar, 2015 1 commit
    • Paul Eggert's avatar
      Merge from gnulib · ccf00107
      Paul Eggert authored
      This incorporates:
      2015-03-19 fdopendir: port better to MinGW
      2015-03-18 fdopendir: fix typo in comment
      2015-02-24 glob, etc.: port to MSVC v18 on MS-Windows 8.1
      * lib/dirent.in.h, lib/fdopendir.c: Update from gnulib.
      * lib/dirfd.c, m4/dirfd.m4: New files from gnulib.
      * lib/gnulib.mk, m4/gnulib-comp.m4: Regenerate.
      ccf00107
  13. 01 Jan, 2015 2 commits
  14. 25 Dec, 2014 1 commit
    • Paul Eggert's avatar
      Prefer stpcpy to strcat · 1e6879db
      Paul Eggert authored
      * admin/merge-gnulib (GNULIB_MODULES): Add stpcpy.
      * lib/gnulib.mk, m4/gnulib-comp.m4: Regenerate.
      * lib/stpcpy.c, m4/stpcpy.m4: New files, from gnulib.
      * lib-src/ebrowse.c (sym_scope_1, operator_name, open_file):
      * lib-src/emacsclient.c (get_server_config, set_local_socket)
      (start_daemon_and_retry_set_socket):
      * lib-src/etags.c (main, C_entries, relative_filename):
      * lib-src/pop.c (sendline):
      * lib-src/update-game-score.c (main):
      * lwlib/xlwmenu.c (resource_widget_value):
      * src/callproc.c (child_setup):
      * src/dbusbind.c (xd_signature_cat):
      * src/doc.c (get_doc_string, Fsnarf_documentation):
      * src/editfns.c (Fuser_full_name):
      * src/frame.c (xrdb_get_resource):
      * src/gtkutil.c (xg_get_file_with_chooser):
      * src/tparam.c (tparam1):
      * src/xfns.c (xic_create_fontsetname):
      * src/xrdb.c (gethomedir, get_user_db, get_environ_db):
      * src/xsmfns.c (smc_save_yourself_CB):
      Rewrite to avoid the need for strcat, typically by using stpcpy
      and/or lispstpcpy.  strcat tends to be part of O(N**2) algorithms.
      * src/doc.c (sibling_etc):
      * src/xrdb.c (xdefaults):
      Now a top-level static constant.
      1e6879db
  15. 19 Oct, 2014 1 commit
    • Paul Eggert's avatar
      Merge from gnulib. · 821339c9
      Paul Eggert authored
      This incorporates:
      2014-10-18 readlinkat: port to AIX 7.1
      2014-10-07 fcntl: fix error reporting by dupfd
      * lib/fcntl.c, lib/readlinkat.c, lib/unistd.in.h, m4/readlinkat.m4:
      * m4/unistd_h.m4: Update from gnulib.
      * lib/gnulib.mk, m4/gnulib-comp.m4: Regenerate.
      821339c9
  16. 30 Aug, 2014 1 commit
    • Paul Eggert's avatar
      Vector-sorting fixes. · f9caea82
      Paul Eggert authored
      It's not safe to call qsort or qsort_r, since they have undefined
      behavior if the user-specified predicate is not a total order.
      Also, watch out for garbage-collection while sorting vectors.
      * admin/merge-gnulib (GNULIB_MODULES): Add vla.
      * configure.ac (qsort_r): Remove, as we no longer use qsort-like
      functions.
      * lib/gnulib.mk, m4/gnulib-comp.m4: Regenerate.
      * lib/vla.h, m4/vararrays.m4: New files, copied from gnulib.
      * lib/stdlib.in.h, m4/stdlib_h.m4: Sync from gnulib, incorporating:
      2014-08-29 qsort_r: new module, for GNU-style qsort_r
      The previous two files' changes are boilerplate generated by
      admin/merge-gnulib, and should not affect Emacs.
      * src/fns.c: Include <vla.h>.
      (sort_vector_predicate) [!HAVE_QSORT_R]: Remove.
      (sort_vector_compare): Remove, replacing with ....
      (inorder, merge_vectors, sort_vector_inplace, sort_vector_copy):
      ... these new functions.
      (sort_vector): Rewrite to use the new functions.
      GCPRO locals, since the predicate can invoke the GC.
      Since it's in-place return void; caller changed.
      (merge): Use 'inorder', for clarity.
      
      Fixes: debbugs:18361
      f9caea82
  17. 17 May, 2014 1 commit
    • Paul Eggert's avatar
      Assume C99 or later. · 8208d2bf
      Paul Eggert authored
      * lib/stdarg.in.h, lib/stdbool.in.h, m4/stdarg.m4, m4/stdbool.m4:
      Remove.
      * configure.ac (_AC_PROG_CC_C89): Define a dummy, to keep 'configure'
      smaller.
      (gl_PROG_CC_C99): Use this to get C99 or later.
      * lib/gnulib.mk, m4/gnulib-comp.m4: Regenerate.
      * admin/merge-gnulib (GNULIB_MODULES): Remove stdarg, stdbool.
      (GNULIB_TOOL_FLAGS): Avoid stdarg, stdbool.
      * doc/lispref/internals.texi (C Dialect): Document this.
      * etc/NEWS: Document this.
      * nt/gnulib.mk: Remove stdarg and stdbool modules.
      * src/bytecode.c (B__dummy__): Remove.
      * src/conf_post.h (bool_bf) [!NS_IMPL_GNUSTEP]: Use bool.
      (FLEXIBLE_ARRAY_MEMBER): Now always empty.
      * src/dbusbind.c (XD_DEBUG_MESSAGE) [!DBUS_DEBUG]:
      * src/regex.c (DEBUG_PRINT): Assume varargs macros.
      * src/lisp.h (DEFUN_FUNCTION_INIT): Remove.  All uses now assume C99.
      
      Fixes: debbugs:17487
      8208d2bf
  18. 07 Mar, 2014 1 commit
    • Paul Eggert's avatar
      Merge from gnulib. · 0d181095
      Paul Eggert authored
      This incorporates:
      2014-03-04 stdint: fix missing SIZE_MAX on Android
      2013-03-02 sys_types: avoid autoconf warning about gl_SYS_TYPES_H
      * lib/gnulib.mk, m4/gnulib-comp.m4: Regenerate.
      * lib/stdint.in.h, lib/sys_types.in.h, m4/sys_types_h.m4:
      Update from gnulib.
      
      Fix oversight preventing lib/sys/types.h from being generated.
      * admin/merge-gnulib (GNULIB_TOOL_FLAGS): Don't avoid sys_types.
      0d181095
  19. 01 Jan, 2014 1 commit
  20. 24 Dec, 2013 1 commit
    • Paul Eggert's avatar
      Automate the procedure for updating copyright year. · 9ebada6a
      Paul Eggert authored
      * admin/merge-gnulib (GNULIB_MODULES): Add update-copyright.
      * admin/notes/years: Mention admin/update-copyright.
      * admin/update-copyright: New file.
      * build-aux/update-copyright: New file.
      * make-dist: Distribute it.
      * lib/gnulib.mk, m4/gnulib-comp.m4: Regenerate.
      * msdos/autogen/Makefile.in: Update copyright year.
      9ebada6a
  21. 08 Dec, 2013 1 commit
    • Paul Eggert's avatar
      Use libcrypto's checksum implementations if available, for speed. · e9551b12
      Paul Eggert authored
      On commonly used platform libcrypto uses architecture-specific
      assembly code, which is significantly faster than the C code we
      were using.  See Pádraig Brady's note in
      <http://lists.gnu.org/archive/html/bug-gnulib/2013-12/msg00000.html>.
      Merge from gnulib, incorporating:
      2013-12-07 md5, sha1, sha256, sha512: add gl_SET_CRYPTO_CHECK_DEFAULT
      2013-12-07 md5, sha1, sha256, sha512: add 'auto', and set-default method
      2013-12-04 include_next: minimize code duplication
      2013-12-03 md5, sha1, sha256, sha512: support mandating use of openssl
      2013-12-02 md5, sha1, sha256, sha512: use openssl routines if available
      * configure.ac (--without-all): Set with_openssl_default too.
      Use gl_SET_CRYPTO_CHECK_DEFAULT to default to 'auto'.
      (HAVE_LIB_CRYPTO): New var.
      Say whether Emacs is configured to use a crypto library.
      * lib/gl_openssl.h, m4/absolute-header.m4, m4/gl-openssl.m4:
      New files, copied from gnulib.
      * lib/gnulib.mk, m4/gnulib-comp.m4: Regenerate.
      * lib/md5.c, lib/md5.h, lib/sha1.c, lib/sha1.h:
      * lib/sha256.c, lib/sha256.h, lib/sha512.c, lib/sha512.h:
      * m4/include_next.m4, m4/md5.m4, m4/sha1.m4, m4/sha256.m4, m4/sha512.m4:
      Update from gnulib.
      * src/Makefile.in (LIB_CRYPTO): New macro.
      (LIBES): Use it.
      e9551b12
  22. 12 Oct, 2013 1 commit
    • Paul Eggert's avatar
      Merge from gnulib. · 46e5e833
      Paul Eggert authored
      This incorporates:
      2013-10-10 strtoumax: port to Solaris 8
      2013-10-09 strtoimax, strtoumax: port to HP-UX 11.11
      * lib/gnulib.mk, m4/gnulib-comp.m4: Regenerate.
      * lib/inttypes.in.h, lib/strtoimax.c, m4/inttypes.m4, m4/strtoimax.m4:
      * m4/strtoumax.m4:
      Update from gnulib.
      46e5e833
  23. 07 Oct, 2013 1 commit
    • Paul Eggert's avatar
      Improve support for popcount and counting trailing zeros. · 595e113b
      Paul Eggert authored
      Do this by using the Gnulib modules for this.
      This should generate faster code on non-GCC, non-MSC platforms,
      and make the code a bit more portable, at least in theory.
      * admin/merge-gnulib (GNULIB_MODULES): Add count-one-bits
      and count-trailing-zeros.
      * lib/count-one-bits.c, lib/count-one-bits.h:
      * lib/count-trailing-zeros.c, lib/count-trailing-zeros.h:
      * m4/count-one-bits.m4, m4/count-trailing-zeros.m4:
      New files, copied from gnulib.
      * lib/gnulib.mk, m4/gnulib-comp.m4: Regenerate.
      * nt/gnulib.mk: Merge changes from lib/gnulib.mk.
      * src/data.c: Include <count-one-bits.h>, <count-trailing-zeros.h>.
      (USE_MSC_POPCOUNT, POPCOUNT_STATIC_INLINE)
      (NEED_GENERIC_POPCOUNT, popcount_size_t_generic)
      (popcount_size_t_msc, popcount_size_t_gcc):
      Remove; now done by Gnulib.
      (popcount_size_t): Now a macro that defers to Gnulib.
      (count_trailing_zero_bits): Return int, for consistency with
      Gnulib and because Emacs prefers signed to unsigned int.
      Don't assume that size_t is either unsigned int or unsigned long
      or unsigned long long.
      (size_t_to_host_endian): Do not assume that size_t is either
      exactly 32 or exactly 64 bits wide.
      * src/lisp.h (BITS_PER_SIZE_T): Define consistently with BITS_PER_LONG
      etc., so that it's now an enum constant, not a macro.
      No need to assume that it's either 32 or 64.
      
      Fixes: debbugs:15550
      595e113b
  24. 04 Oct, 2013 1 commit
    • Paul Eggert's avatar
      Use hardware support for byteswapping on glibc x86 etc. · 4eed3157
      Paul Eggert authored
      On Fedora 19 x86-64, the new bswap_64 needs 1 instruction,
      whereas the old swap64 needed 30.
      * admin/merge-gnulib (GNULIB_MODULES): Add byteswap.
      * lib/byteswap.in.h, m4/byteswap.m4: New files, copied from Gnulib.
      * lib/gnulib.mk, m4/gnulib-comp.m4: Regenerate.
      * src/fringe.c (init_fringe_bitmap) [WORDS_BIGENDIAN]:
      * src/sound.c (le2hl, le2hs, be2hl) [!WINDOWSNT]:
      Use byteswap.h's macros to swap bytes.
      * src/lisp.h (swap16, swap32, swap64): Remove.
      All uses replaced by bswap_16, bswap_32, bswap_64.
      4eed3157
  25. 03 Oct, 2013 1 commit
    • Paul Eggert's avatar
      Merge from gnulib. · 0a858ebf
      Paul Eggert authored
      * src/conf_post.h (__has_builtin, assume): Remove; gnulib now does these.
      * src/lisp.h: Include <verify.h>, for 'assume'.
      
      This also incorpoprates:
      2013-10-02 verify: new macro 'assume'
      2013-09-26 dup2, dup3: work around another cygwin crasher
      2013-09-26 getdtablesize: work around cygwin issue
      0a858ebf
  26. 12 Aug, 2013 1 commit
    • Paul Eggert's avatar
      Merge from gnulib. · eaca0446
      Paul Eggert authored
      This incorporates:
      2013-08-11 fpending: port to recent Cygwin change to stdio_ext.h
      2013-08-10 sys_time: port to OpenBSD
      eaca0446
  27. 04 Aug, 2013 1 commit
    • Paul Eggert's avatar
      Fix some minor races in hosts lacking mkostemp. · e0fdb694
      Paul Eggert authored
      Gnulib's emulation of mkostemp doesn't have races that Emacs's does.
      * configure.ac (mkostemp): Remove check for this function;
      gnulib does the check now.
      (mkstemp): Remove check for this no-longer-used function.
      * lib/mkostemp.c, lib/secure_getenv.c, lib/tempname.c, lib/tempname.h:
      * m4/mkostemp.m4, m4/secure_getenv.m4, m4/tempname.m4:
      New files, copied from Gnulib.
      * lib/gnulib.mk, m4/gnulib-comp.m4: Regenerate.
      * admin/merge-gnulib (GNULIB_MODULES): Add mkostemp.
      * lib-src/movemail.c (main):
      * lib-src/update-game-score.c (write_scores):
      Use mkostemp (which now works on all platforms, due to changes
      in the portability layer) rather than mktemp (which has a race)
      or mkstemp (which we no longer bother with).
      * src/callproc.c (create_temp_file):
      * src/filelock.c (create_lock_file):
      Assume mkostemp, since it's now provided by Gnulib.
      
      Fixes: debbugs:15015
      e0fdb694
  28. 09 Jul, 2013 2 commits
    • Paul Eggert's avatar
      Port recent close-on-exec changes to Cygwin. · 7b154def
      Paul Eggert authored
      * lib/binary-io.c, lib/binary-io.h: New files.
      Merge from gnulib, incorporating:
      2013-07-09 accept4, dup3, pipe2: port to Cygwin
      * lib/pipe2.c: Update from gnulib, as part of this merge.
      * lib/gnulib.mk, m4/gnulib-comp.m4: Regenerate.
      
      Fixes: debbugs:14821
      7b154def
    • Paul Eggert's avatar
      Handle errno and exit status a bit more carefully. · 4ebbdd67
      Paul Eggert authored
      * lib/ignore-value.h: Remove this gnulib-imported file.
      * lib/gnulib.mk, m4/gnulib-comp.m4: Regenerate.
      * admin/merge-gnulib (GNULIB_MODULES): Remove ignore-value.
      * src/callproc.c (child_setup) [!DOS_NT]: Don't try to stuff an error
      number into an exit status.  Instead, use EXIT_CANCELED.
      (child_setup) [!MSDOS]: Avoid possible deadlock with vfork.
      * src/callproc.c (relocate_fd):
      * src/emacs.c (close_output_streams, main):
      * src/process.c (create_process):
      * src/sysdep.c (sys_subshell) [!DOS_NT || !WINDOWSNT]:
      Use emacs_perror for simplicity.
      * src/callproc.c (relocate_fd, main):
      * src/sysdep.c (sys_subshell):
      Exit with EXIT_CANCELED etc., not 1, when exec setup fails.
      (shut_down_emacs): Use emacs_write, not write.
      * src/emacs.c, src/sysdep.c: Don't include <ignore-value.h>.
      * src/fileio.c (Fcopy_file, e_write):
      * src/nsterm.m (ns_select):
      * src/process.c (send_process):
      * src/sound.c (vox_write):
      Use emacs_write_sig, not emacs_write.
      * src/lisp.h (emacs_write_sig, emacs_perror): New decls.
      * src/process.h (EXIT_CANCELED), EXIT_CANNOT_INVOKE, EXIT_ENOENT):
      New constants.
      * src/sysdep.c (emacs_backtrace): Use emacs_write, not ignore_value
      of write.
      (emacs_full_write): New function.
      (emacs_write): Rewrite to use it.
      (emacswrite_sig, emacs_perror): New functions.
      * src/xrdb.c (fatal): Don't invoke perror, since errno might be garbage.
      4ebbdd67
  29. 07 Jul, 2013 1 commit
    • Paul Eggert's avatar
      Make file descriptors close-on-exec when possible. · 067428c1
      Paul Eggert authored
      This simplifies Emacs a bit, since it no longer needs to worry
      about closing file descriptors by hand in some cases.
      It also fixes some unlikely races.  Not all such races, as
      libraries often open files internally without setting
      close-on-exec, but it's an improvement.
      * admin/merge-gnulib (GNULIB_MODULES): Add fcntl, pipe2.
      (GNULIB_TOOL_FLAGS): Avoid binary-io, close.  Do not avoid fcntl.
      * configure.ac (mkostemp): New function to check for.
      (PTY_OPEN): Pass O_CLOEXEC to posix_openpt.
      * lib/fcntl.c, lib/getdtablesize.c, lib/pipe2.c, m4/fcntl.m4:
      * m4/getdtablesize.m4, m4/pipe2.m4: New files, taken from gnulib.
      * lib/gnulib.mk, m4/gnulib-comp.m4: Regenerate.
      * nt/gnulib.mk: Remove empty gl_GNULIB_ENABLED_verify section;
      otherwise, gnulib-tool complains given close-on-exec changes.
      * nt/inc/ms-w32.h (pipe): Remove.
      * nt/mingw-cfg.site (ac_cv_func_fcntl, gl_cv_func_fcntl_f_dupfd_cloexec)
      (gl_cv_func_fcntl_f_dupfd_works, ac_cv_func_pipe2): New vars.
      * src/alloc.c (valid_pointer_p) [!WINDOWSNT]:
      * src/callproc.c (Fcall_process) [!MSDOS]:
      * src/emacs.c (main) [!DOS_NT]:
      * src/nsterm.m (ns_term_init):
      * src/process.c (create_process):
      Use 'pipe2' with O_CLOEXEC instead of 'pipe'.
      * src/emacs.c (Fcall_process_region) [HAVE_MKOSTEMP]:
      * src/filelock.c (create_lock_file) [HAVE_MKOSTEMP]:
      Prefer mkostemp with O_CLOEXEC to mkstemp.
      * src/callproc.c (relocate_fd) [!WINDOWSNT]:
      * src/emacs.c (main): Use F_DUPFD_CLOEXEC, not plain F_DUPFD.
      No need to use fcntl (..., F_SETFD, FD_CLOEXEC), since we're
      now using pipe2.
      * src/filelock.c (create_lock_file) [! HAVE_MKOSTEMP]:
      Make the resulting file descriptor close-on-exec.
      * src/lisp.h, src/lread.c, src/process.c (close_load_descs, close_process_descs):
      * src/lread.c (load_descriptor_list, load_descriptor_unwind):
      Remove; no longer needed.  All uses removed.
      * src/process.c (SOCK_CLOEXEC): Define to 0 if not supplied by system.
      (close_on_exec, accept4, process_socket) [!SOCK_CLOEXEC]:
      New functions.
      (socket) [!SOCK_CLOEXEC]: Supply a substitute.
      (Fmake_network_process, Fnetwork_interface_list):
      (Fnetwork_interface_info, server_accept_connection):
      Make newly-created socket close-on-exec.
      * src/sysdep.c (emacs_open, emacs_fopen):
      Make new-created descriptor close-on-exec.
      * src/w32.c (fcntl): Support F_DUPFD_CLOEXEC well enough for Emacs.
      * src/w32.c, src/w32.h (pipe2): Rename from 'pipe', with new flags arg.
      
      Fixes: debbugs:14803
      067428c1
  30. 07 May, 2013 1 commit
    • Paul Eggert's avatar
      Use Gnulib ACL implementation, for benefit of Solaris etc. · ffdc270a
      Paul Eggert authored
      * configure.ac: Remove -with-acl option, since Gnulib does that for
      us now.
      (LIBACL_LIBS): Remove; no longer needed.
      * lib/Makefile.am (CLEANFILES, SUFFIXES): New (empty) macros,
      for the benefit of the new ACL implementation.
      * lib/makefile.w32-in (GNULIBOBJS): Add $(BLD)/acl-errno-valid.$(O).
      ($(BLD)/acl-errno-valid.$(O)): New rule.
      * lib/acl-errno-valid.c, lib/acl-internal.h, lib/acl.h:
      * lib/acl_entries.c, lib/errno.in.h, lib/file-has-acl.c:
      * lib/qcopy-acl.c, lib/qset-acl.c, m4/acl.m4, m4/errno_h.m4:
      New files, taken from gnulib.
      * lib/gnulib.mk, m4/gnulib-comp.m4: Regenerate.
      * admin/merge-gnulib (GNULIB_MODULES): Add qacl.
      (GNULIB_TOOL_FLAGS): Do not avoid errno.
      * etc/NEWS: Emacs is no longer limited to POSIX ACLs.  --disable-acl,
      not --without-acl, since we're now using Gnulib's implementation.
      * nt/config.nt (HAVE_ACL_SET_FILE): Rename from HAVE_POSIX_ACL.
      * nt/inc/ms-w32.h (EOPNOTSUPP): New macro.
      * src/Makefile.in (LIB_ACL): New macro.
      (LIBACL_LIBS): Remove.
      (LIBES): Use LIB_ACL, not LIBACL_LIBS.
      * src/fileio.c: Include <acl.h>.
      Use HAVE_ACL_SET_FILE rather than HAVE_POSIX_ACL.
      (ACL_NOT_WELL_SUPPORTED): Remove.  All uses replaced by
      !acl_errno_valid.
      (Fcopy_file) [!WINDOWSNT]: Use qcopy_acl instead of rolling
      it ourselves.
      
      Fixes: debbugs:14295
      ffdc270a
  31. 13 Mar, 2013 1 commit
    • Paul Eggert's avatar
      File synchronization fixes. · 47d7532e
      Paul Eggert authored
      * 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
      47d7532e
  32. 01 Mar, 2013 1 commit
    • Paul Eggert's avatar
      Merge from gnulib. · 89bd9d36
      Paul Eggert authored
      2013-02-21 putenv: port better to native Windows
      2013-02-18 extern-inline: avoid compilation error with HP-UX cc
      2013-02-14 putenv: fix heap corruption with mixed putenv/_putenv
      89bd9d36
  33. 11 Feb, 2013 1 commit
    • Paul Eggert's avatar
      Tune by using memchr and memrchr. · a84b7c53
      Paul Eggert authored
      * .bzrignore: Add string.h.
      * admin/merge-gnulib (GNULIB_MODULES): Add memrchr.
      * lib/gnulib.mk, m4/gnulib-comp.m4: Regenerate.
      * lib/memrchr.c, lib/string.in.h, m4/memrchr.m4, m4/string_h.m4:
      New files, from gnulib.
      * src/doc.c (Fsnarf_documentation):
      * src/fileio.c (Fsubstitute_in_file_name):
      * src/search.c (find_newline, scan_newline):
      * src/xdisp.c (pos_visible_p, display_count_lines):
      Use memchr and memrchr rather than scanning byte-by-byte.
      * src/search.c (find_newline): Rename from scan_buffer.
      Omit first arg TARGET, as it's always '\n'.  All callers changed.
      a84b7c53
  34. 01 Feb, 2013 1 commit
    • Paul Eggert's avatar
      Use fdopendir, fstatat and readlinkat, for efficiency. · 8654f9d7
      Paul Eggert authored
      On my host, this speeds up directory-files-and-attributes by a
      factor of 3, when applied to Emacs's src directory.
      These functions are standardized by POSIX and are common these
      days; fall back on a (slower) gnulib implementation if the host
      is too old to supply them.
      * .bzrignore: Add lib/dirent.h.
      * lib/Makefile.am (libgnu_a_SOURCES): Add openat-die.c, save-cwd.c.
      * lib/careadlinkat.c, lib/careadlinkat.h: Merge from gnulib,
      incorporating: 2013-01-29 careadlinkat: do not provide careadlinkatcwd.
      * lib/gnulib.mk, m4/gnulib-comp.m4: Regenerate.
      * lib/dirent.in.h, lib/fdopendir.c, lib/fstatat.c, lib/openat-priv.h:
      * lib/openat-proc.c, lib/openat.h, m4/dirent_h.m4, m4/fdopendir.m4:
      * m4/fstatat.m4: New files, from gnulib.
      * lib/openat-die.c, lib/save-cwd.c, lib/save-cwd.h: New files.
      These last three are specific to Emacs and are not copied from gnulib.
      They are simpler than the gnulib versions and are tuned for Emacs.
      * admin/merge-gnulib (GNULIB_MODULES): Add fdopendir, fstatat, readlinkat.
      (GNULIB_TOOL_FLAGS): Do not avoid at-internal, openat-h.
      Avoid dup, open, opendir.
      * nt/inc/sys/stat.h (fstatat):
      * nt/inc/unistd.h (readlinkat): New decls.
      * src/conf_post.h (GNULIB_SUPPORT_ONLY_AT_FDCWD): Remove.
      * src/dired.c: Include <fcntl.h>.
      (open_directory): New function, which uses open and fdopendir
      rather than opendir.  DOS_NT platforms still use opendir, though.
      (directory_files_internal, file_name_completion): Use it.
      (file_attributes): New function, with most of the old Ffile_attributes.
      (directory_files_internal, Ffile_attributes): Use it.
      (file_attributes, file_name_completion_stat): First arg is now fd,
      not dir name.  All uses changed.  Use fstatat rather than lstat +
      stat.
      (file_attributes): Use emacs_readlinkat rather than Ffile_symlink_p.
      * src/fileio.c: Include <allocator.h>, <careadlinkat.h>.
      (emacs_readlinkat): New function, with much of the old
      Ffile_symlink_p, but with an fd argument for speed.
      It uses readlinkat rather than careadlinkatcwd, so that it
      need not assume the working directory.
      (Ffile_symlink_p): Use it.
      * src/filelock.c (current_lock_owner): Use emacs_readlinkat
      rather than emacs_readlink.
      * src/lisp.h (emacs_readlinkat): New decl.
      (READLINK_BUFSIZE, emacs_readlink): Remove.
      * src/sysdep.c: Do not include <allocator.h>, <careadlinkat.h>.
      (emacs_norealloc_allocator, emacs_readlink): Remove.
      This stuff is moved to fileio.c.
      * src/w32.c (fstatat, readlinkat): New functions.
      (careadlinkat): Don't check that fd == AT_FDCWD.
      (careadlinkatcwd): Remove; no longer needed.
      
      Fixes: debbugs:13539
      8654f9d7
  35. 04 Jan, 2013 1 commit
    • Paul Eggert's avatar
      Merge from gnulib. · ee0d3938
      Paul Eggert authored
      This incorporates:
      2013-01-04 stdio: remove now-unnecessary stdio.c
      2013-01-04 fprintftime: depend on stdio, not ignore-value
      2013-01-04 fwrite: silence __wur only for older glibc versions
      2013-01-04 fwrite: silence __wur without using inline
      * lib/stdio.c: Remove.
      * lib/stdio.in.h, lib/strftime.c: Update from gnulib.
      * lib/gnulib.mk, m4/gnulib-comp.m4: Regenerate.
      ee0d3938
  36. 02 Jan, 2013 1 commit
  37. 08 Dec, 2012 1 commit
    • Paul Eggert's avatar
      Use putenv+unsetenv instead of modifying environ directly. · 5745a7df
      Paul Eggert authored
      * admin/merge-gnulib (GNULIB_MODULES): Add putenv, unsetenv.
      * lib/putenv.c, lib/unsetenv.c, m4/putenv.m4, m4/setenv.m4:
      New files, copied automatically from gnulib.
      * lib/gnulib.mk, m4/gnulib-comp.m4: Regenerate.
      * src/alloc.c (xputenv): New function.
      * src/dbusbind.c (Fdbus_init_bus):
      * src/emacs.c (main):
      * src/xterm.c (x_term_init):
      Use xputenv instead of setenv or putenv, to detect memory exhaustion.
      * src/editfns.c (initial_tz): Move static var decl up.
      (tzvalbuf_in_environ): New static var.
      (init_editfns):	Initialize these two static vars.
      (Fencode_time): Don't assume arbitrary limit on EMACS_INT width.
      Save old TZ value on stack, if it's small.
      (Fencode_time, set_time_zone_rule): Don't modify 'environ' directly;
      instead, use xputenv+unsetenv to set and restore TZ.
      (environbuf): Remove static var.  All uses removed.
      (Fset_time_zone_rule): Do not save TZ and environ;
      no longer needed here.
      (set_time_zone_rule_tz1, set_time_zone_rule_tz2) [LOCALTIME_CACHE]:
      Move to inside set_time_zone_rule; they don't need file scope any more.
      (set_time_zone_rule): Maintain the TZ=value string separately.
      (syms_of_editfns): Don't initialize initial_tz;
      init_editfns now does it.
      * src/emacs.c (dump_tz) [HAVE_TZSET]: Now const.
      * src/lisp.h (xputenv): New decl.
      
      Fixes: debbugs:13070
      5745a7df