summaryrefslogtreecommitdiff
path: root/lib
Commit message (Expand)AuthorAgeFilesLines
* Vector-sorting fixes....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 Paul Eggert2014-08-303-1/+60
* Merge from emacs-24; up to 2014-06-28T23:35:17Z!rgm@gnu.orgGlenn Morris2014-08-102-27/+101
|\
| * Simplify previous patch....Fixes: debbugs:18232 Paul Eggert2014-08-101-10/+8
| * Don't prevent random file systems from being unmounted....This fix relies on having the 'fchdir' function, and on having "." be searchable (or at least readable, on platforms lacking O_SEARCH), but that's good enough to handle the vast majority of cases and the remaining folks can just live with the annoyance of file systems that occasionally can't be unmounted. * configure.ac (fchdir): New function to check for. * lib/save-cwd.c: Copy from gnulib, except omit the part that allocates memory, since that can cause problems in Emacs. * lib/save-cwd.h: Copy from gnulib. Fixes: debbugs:18232 Paul Eggert2014-08-102-27/+103
| * Backport fcntl.h AIX fix from the trunk....This fixes a bug with the shell freezing. See: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=17598#185 Merge from gnulib, incorporating: 2014-05-31 dup2, fcntl, fcntl-h: port to AIX 7.1 * lib/fcntl.in.h, m4/dup2.m4, m4/fcntl.m4: Update from gnulib. Paul Eggert2014-06-111-0/+16
| * Fix port to 32-bit AIX with xlc....This doesn't fix Bug#17598, but it does fix a regression since Emacs built with xlc until recently, and perhaps it'll help us fix Bug#17598. * configure.ac (GC_SETJMP_WORKS): Define for AIX, too. Merge from gnulib, incorporating: 2014-05-30 ftoastr: work around compiler bug in IBM xlc 12.1 * lib/ftoastr.c: Update from gnulib. * src/alloc.c (gdb_make_enums_visible): Remove FLOAT_TO_STRING_BUFSIZE. * src/conf_post.h (FLEXIBLE_ARRAY_MEMBER) [__IBMC__]: Don't define to empty. * src/lisp.h (FLOAT_TO_STRING_BUFSIZE): Make it a macro, instead of an enum, to work around a compiler bug in IBM xlc 12.1. Paul Eggert2014-05-301-8/+9
* | Merge from gnulib....This incorporates: 2014-08-07 getdtablesize: fall back on sysconf (_SC_OPEN_MAX) 2014-08-05 sys_select: fix FD_ZERO problem on Solaris 10 * lib/getdtablesize.c, lib/sys_select.in.h: Update from gnulib. Paul Eggert2014-08-082-7/+16
* | Merge from gnulib, incorporating:...2014-08-04 extern-inline: port to FreeBSD, DragonFly * lib/gnulib.mk: Regenerate (comment change only). * m4/extern-inline.m4: Update from gnulib. Paul Eggert2014-08-041-1/+1
* | Merge from gnulib, incorporating:...2014-06-27 mktime: merge #if/#ifdef usage from glibc * lib/mktime.c: Update from gnulib. Paul Eggert2014-07-121-2/+2
* | Omit redundant extern decls....Most of this patch is from Dmitry Antipov, in: http://lists.gnu.org/archive/html/emacs-devel/2014-06/msg00263.html * configure.ac (WERROR_CFLAGS): Add -Wredundant-decls. * lib-src/emacsclient.c (getenv): Remove decl. * lib-src/make-docfile.c (write_globals): Add ATTRIBUTE_CONST for Fbyteorder, Ftool_bar_height, Fmax_char, Fidentity. * lwlib/lwlib-Xm.c (lw_motif_widget_p, xm_update_one_value) (xm_create_dialog, xm_destroy_instance, xm_popup_menu) (xm_set_keyboard_focus, xm_set_main_areas): Remove decls. * src/commands.h (update_mode_lines): * src/frame.h (Qbackground_color, Qforeground_color) (x_set_menu_bar_lines): * src/ftfont.c (ftfont_font_format): * src/intervals.h (Qkeymap, Qfont): * src/keyboard.c (timer_check, safe_run_hooks, Qregion_extract_function): * src/lisp.h (Ffboundp, Qnil, Qt, Qlambda, Qintegerp, Qwholenump) (Qsymbolp, Qlisp, Qconsp, Qstringp, Qarrayp, Qbufferp, Qmarkerp) (Qvectorp, Qbuffer_or_string_p, Qchar_table_p, Qvector_or_char_table_p) (Qfloatp, Qnumberp, Qfont_spec, Qfont_entity, Qfont_object) (Fbyteorder, wrong_type_argument, Fmax_char, syms_of_composite) (Fidentity, extract_float, init_display, syms_of_display, Qdisplay): (Qimage, Qbox, redisplay_preserve_echo_area, char_table_ref) (char_table_set, char_table_translate, Qautoload, Qbottom, Qtop) (Qvisible, Qfont, Qfront_sticky, Qrear_nonsticky, init_sigio) (Qtool_bar, Qheader_line): * src/macros.c (Fexecute_kbd_macro): * src/xdisp.c (Ftool_bar_height, Ftool_bar_height): * src/xterm.c (x_delete_terminal, XSetIMValues): * src/xterm.h (x_set_window_size, x_query_color, x_get_focus_frame) (x_implicitly_set_name, popup_activated) (widget_store_internal_border): Remove redundant decls. * src/frame.c [USE_X_TOOLKIT]: Include widget.h. * src/keyboard.c (Fexit_recursive_edit, Fabort_recursive_edit): Remove _Noreturn, as make-docfile now does that for us. * src/lisp.h (DEFUN): Don't declare fnname here; rely on make-docfile. (Qregion_extract_function): New decl. * src/window.c, src/xfns.c: Include menu.h. Paul Eggert2014-06-171-0/+5
* | Parallelize clean rules using GNU make features...* Makefile.in: (submake_template): New definition. (mostlyclean_dirs, clean_dirs, distclean_dirs, maintainer_clean_dirs): New variables. (mostlyclean, clean, distclean, bootstrap-clean, maintainer-clean) (extraclean): Define using each subdirectory as a prequisite. * lib/Makefile.am (bootstrap-clean): * doc/emacs/Makefile.in (bootstrap-clean): * doc/lispintro/Makefile.in (bootstrap-clean): * doc/lispref/Makefile.in (bootstrap-clean): * doc/misc/Makefile.in (bootstrap-clean): * lib-src/Makefile.in (bootstrap-clean): * lwlib/Makefile.in (bootstrap-clean): * nextstep/Makefile.in (bootstrap-clean): * nt/Makefile.in (bootstrap-clean): * oldXMenu/Makefile.in (bootstrap-clean): New rules, for symmetry/simplicity. * lwlib/Makefile.in (mostlyclean, clean, distclean, maintainer-clean): * oldXMenu/Makefile.in (mostlyclean, clean, distclean, maintainer-clean, tags): Declare as PHONY. Glenn Morris2014-06-141-0/+4
* | Merge from gnulib....This incorporates: 2014-06-02 acl: apply pure attribute to two functions 2014-06-01 gnulib-common.m4: add _GL_UNUSED_LABEL 2014-05-31 dup2, fcntl, fcntl-h: port to AIX 7.1 2014-05-30 ftoastr: work around compiler bug in IBM xlc 12.1 * lib/acl-internal.h, lib/fcntl.in.h, lib/ftoastr.h: * m4/dup2.m4, m4/fcntl.m4, m4/gnulib-common.m4: Update from gnulib. Paul Eggert2014-06-013-10/+27
* | Merge from gnulib....This incorporates: 2014-05-21 fchdir: port 'open' and 'close' redefinitions to AIX 7.1 * doc/misc/texinfo.tex, lib/openat-proc.c: Update from gnulib. Paul Eggert2014-05-261-8/+0
* | Assume C99 or later....* 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 Paul Eggert2014-05-173-219/+1
|/
* Merge from gnulib....This incorporates: 2014-03-26 strftime: wrap macros in "do {...} while(0)" * lib/strftime.c, doc/misc/texinfo.tex: Update from gnulib. Paul Eggert2014-03-251-14/+34
* Merge from gnulib....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. Paul Eggert2014-03-073-3/+29
* Merge from gnulib....2014-02-25 unistd: port readlink to Mac OS X 10.3.9 Fixes: debbugs:16825 Paul Eggert2014-02-251-0/+15
* Merge from gnulib....This incorporates: 2014-01-23 pthread: work around winpthread header pollution on mingw * lib/time.in.h: Update from gnulib. * doc/misc/texinfo.tex: Update from texinfo. Paul Eggert2014-02-051-9/+2
* Merge from gnulib....This incorporates: 2014-01-20 stdalign: port to HP-UX compilers 2014-01-16 strtoimax: port to platforms lacking 'long long' 2014-01-16 update from texinfo * doc/misc/texinfo.tex, lib/stdalign.in.h, lib/strtoimax.c: Update from gnulib. Paul Eggert2014-01-202-7/+12
* Fix copyright years by hand....These are dates that admin/update-copyright did not update, or updated incorrectly. Paul Eggert2014-01-011-1/+1
* Update copyright year to 2014 by running admin/update-copyright.Paul Eggert2014-01-01122-123/+123
* Automate the procedure for updating copyright year....* 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. Paul Eggert2013-12-241-1/+8
* Merge from gnulib, incorporating:...2013-12-17 gettimeofday: port recent C++ fix to Emacs 2013-12-17 gettimeofday: fix C++ crosscompilation 2013-12-17 qacl: port to Windows better * lib/file-has-acl.c, lib/time.in.h, m4/gettimeofday.m4, m4/time_h.m4: Update from gnulib. * lib/gnulib.mk: Regenerate. Paul Eggert2013-12-173-5/+42
* Remove the option of using libcrypto....This scorches the earth and waits for spring; see Ted Zlatanov and Stefan Monnier in <http://lists.gnu.org/archive/html/emacs-devel/2013-12/msg00323.html>. * configure.ac (with_openssl_default, HAVE_LIB_CRYPTO): Remove. Do not say whether Emacs is configured to use a crypto library, since it's no longer an option. (gl_CRYPTO_CHECK): Define a dummy. * lib/gl_openssl.h, m4/gl-openssl.m4: Remove. * admin/merge-gnulib: Remove lib/gl_openssh.h and m4/gl-openssl.m4. * src/Makefile.in (LIB_CRYPTO): Remove. (LIBES): Don't use it. Paul Eggert2013-12-101-116/+0
* Use libcrypto's checksum implementations if available, for speed....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. Paul Eggert2013-12-0810-34/+229
* Merge from gnulib, incorporating:...2013-11-13 getgroups: work around _DARWIN_C_SOURCE problem * lib/getgroups.c: Update from gnulib. Paul Eggert2013-11-271-0/+15
* Merge from gnulib....This incorporates: 2013-11-08 extern-inline: port better to OS X 10.9 2013-11-08 fpending: fix regression on DragonFly BSD * lib/fpending.h, m4/extern-inline.m4, m4/fpending.m4: Update from gnulib. Paul Eggert2013-11-081-1/+1
* Port to stricter C99 platforms....Especially, C99 prohibits nesting a struct X inside struct Y if struct X has a flexible array member. Also, merge from gnulib, incorporating: 2013-11-03 intprops: port to Oracle Studio c99 * lib/intprops.h: Update from gnulib. * src/alloc.c (struct sdata): New type. (sdata): Implement in terms of struct sdata. Remove u member; all uses replaced by next_vector, set_next_vector. (SDATA_SELECTOR, SDATA_DATA, SDATA_DATA_OFFSET): Adjust to sdata change. (SDATA_DATA_OFFSET): Now a constant, not a macro. (struct sblock): Rename first_data member to data, which is now a flexible array member. All uses changed. (next_vector, set_next_vector, large_vector_vec): New functions. (vector_alignment): New constant. (roundup_size): Make it a multiple of ALIGNOF_STRUCT_LISP_VECTOR, too. (struct large-vector): Now merely a NEXT member, since the old approach ran afoul of stricter C99. All uses changed to use large_vector_vec or large_vector_offset. (large_vector_offset): New constant. * src/dispnew.c: Include tparam.h, for tgetent. Do not include term.h; no longer needed. * src/gnutls.c (Fgnutls_boot): Don't continue after calling a _Noreturn. * src/lisp.h (ENUM_BF) [__SUNPRO_C && __STDC__]: Use unsigned int. (struct Lisp_Vector): Use a flexible array member for contents, instead of a union with a member that is an array of size 1. All uses changed. (ALIGNOF_STRUCT_LISP_VECTOR): New constant, to make up for the fact that the struct no longer contains a union. (struct Lisp_Misc_Any, struct Lisp_Marker, struct Lisp_Overlay) (struct Lisp_Save_Value, struct Lisp_Free): Use unsigned, not int, for spacers, to avoid c99 warning. (union specbinding): Use unsigned, not bool, for bitfield, as bool is not portable to pre-C99 hosts. Paul Eggert2013-11-031-1/+2
* Merge from gnulib....This incorporates: 2013-10-14 acl: allow cross-compilation to Gentoo 2013-10-18 extern-inline: make safe for -Wundef usage 2013-09-30 fpending: use pure+const function attrs * lib/fpending.h, m4/acl.m4, m4/extern-inline.m4: Update from gnulib. Paul Eggert2013-10-221-1/+1
* Merge from gnulib....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. Paul Eggert2013-10-123-9/+23
* Improve support for popcount and counting trailing zeros....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 Paul Eggert2013-10-075-1/+269
* Use hardware support for byteswapping on glibc x86 etc....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. Paul Eggert2013-10-042-1/+68
* Merge from gnulib....* 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 Paul Eggert2013-10-035-8/+67
* Merge from gnulib....This incorporates: 2013-09-24 manywarnings: enable nicer gcc warning messages 2013-09-23 warnings: port --enable-gcc-warnings to Solaris Studio 12.3 2013-09-21 timespec: use the new TIMESPEC_RESOLUTION elsewhere * configure.ac (WERROR_CFLAGS): Omit -fdiagnostics-show-option and -funit-at-a-time, since manywarnings does that for us now. Paul Eggert2013-09-242-5/+5
* Merge from gnulib....This incorporates the following changes: 2013-09-19 stdio: OS X port of putc_unlocked + extern inline 2013-09-19 signal: OS X port of sigaddset etc. + extern inline 2013-09-19 extern-inline: do not always suppress extern inline on OS X 2013-09-17 getgroups: statement without effect 2013-08-28 headers: check that _GL_INLINE_HEADER_BEGIN is defined Paul Eggert2013-09-1916-33/+69
* Simplify EMACS_TIME-related code....This portability layer is no longer needed, since Emacs has been using struct timespec as a portability layer for some time. Merge from gnulib, incorporating: 2013-08-27 timespec: new convenience constants and function * src/atimer.h, src/buffer.h, src/dispextern.h, src/xgselect.h: Include <time.h> rather than "systime.h"; that's all that's needed now. * src/dispnew.c: Include <timespec.h> rather than "systime.h"; that's all that's needed now. * src/systime.h (EMACS_TIME): Remove. All uses changed to struct timespec. (EMACS_TIME_RESOLUTION): Remove. All uses changed to TIMESPEC_RESOLUTION. (LOG10_EMACS_TIME_RESOLUTION): Remove. All uses changed to LOG10_TIMESPEC_RESOLUTION. (EMACS_SECS, emacs_secs_addr): Remove. All uses changed to tv_sec. (EMACS_NSECS): Remove. All uses changed to tv_nsec. (make_emacs_time): Remove. All used changed to make_timespec. (invalid_timespec): Rename from invalid_emacs_time. All uses changed. (current_timespec): Rename from current_emacs_time. All uses changed. (add_emacs_time): Remove. All uses changed to timespec_add. (sub_emacs_time): Remove. All uses change dot timespec_sub. (EMACS_TIME_SIGN): Remove. All uses changed to timespec_sign. (timespec_valid_p): Rename from EMACS_TIME_VALID_P. All uses changed. (EMACS_TIME_FROM_DOUBLE): Remove. All uses changed to dtotimespec. (EMACS_TIME_TO_DOUBLE): Remove. All uses changed to timespectod. (current_timespec): Rename from current_emacs_time. All uses changed. (EMACS_TIME_EQ, EMACS_TIME_LT, EMACS_TIME_LE): Remove. All uses changed to timespec_cmp. * src/xgselect.c: Include <timespec.h>, since our .h files don't. Paul Eggert2013-08-271-0/+17
* Merge from gnulib....This incorporates: 2013-08-11 fpending: port to recent Cygwin change to stdio_ext.h 2013-08-10 sys_time: port to OpenBSD Paul Eggert2013-08-112-7/+7
* Fix some minor races in hosts lacking mkostemp....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 Paul Eggert2013-08-045-1/+474
* Port recent close-on-exec changes to Cygwin....* 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 Paul Eggert2013-07-094-9/+87
* Handle errno and exit status a bit more carefully....* 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. Paul Eggert2013-07-092-56/+1
* Try to fix FreeBSD 9.1 porting problem....This incorporates the following merge from gnulib: 2013-07-07 stdalign, verify: port to FreeBSD 9.1, to C11, and to C++11 Fixes: debbugs:14812 Paul Eggert2013-07-072-62/+89
* Make file descriptors close-on-exec when possible....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 Paul Eggert2013-07-074-3/+595
* Merge from gnulib....This incorporates: 2013-06-23 ignore-value: port to gcc -pedantic 2013-06-21 extern-inline: port to gcc -std=c89 Paul Eggert2013-07-011-6/+7
* Merge from gnulib....This incorporates: 2013-06-02 sig2str: port to C++ 2013-05-29 c-ctype, regex, verify: port to gcc -std=c90 -pedantic Paul Eggert2013-06-093-2/+13
* Merge from trunk.Eli Zaretskii2013-05-162-6/+20
|\
| * Merge from gnulib....2013-05-15 manywarnings: update for GCC 4.8.0 2013-05-15 stdio: use __REDIRECT for fwrite, fwrite_unlocked 2013-05-15 sig2str, stdio, warnings: port to clang Paul Eggert2013-05-162-6/+20
* | Merge from trunk, configury not fixed yet.Eli Zaretskii2013-05-1512-10/+2936
|\|
| * lib/makefile.w32-in (ACL_H): New macro....($(BLD)/acl-errno-valid.$(O)): Update dependencies. Juanma Barranquero2013-05-081-3/+5
| * Use Gnulib ACL implementation, for benefit of Solaris etc....* 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 Paul Eggert2013-05-0711-2/+2918
| * Merge from gnulib....This incorporates: 2013-04-30 utimens, utimensat: work around Solaris UTIME_OMIT bug Paul Eggert2013-05-061-8/+16