Find a file
Paul Eggert 6d4e8f62e9 Fix a race condition with glib (Bug#8855).
This is a backport from the trunk, consisting of:

2012-11-17  Eli Zaretskii  <eliz@gnu.org>

* nt/inc/sys/wait.h: New file, with prototype of waitpid and
definitions of macros it needs.
* nt/inc/ms-w32.h (wait): Don't define, 'wait' is not used anymore.
(sys_wait): Remove prototype.
* nt/config.nt (HAVE_SYS_WAIT_H): Define to 1.
* src/w32proc.c (create_child): Don't clip the PID of the child
process to fit into an Emacs integer, as this is no longer a
restriction.
(waitpid): Rename from sys_wait.  Emulate a Posix 'waitpid' by
reaping only the process specified by PID argument, if that is
positive.  Use PID instead of dead_child to know which process to
reap.  Wait for the child to die only if WNOHANG is not in
OPTIONS.
(sys_select): Don't set dead_child.
* src/sysdep.c (wait_for_termination_1): Remove the WINDOWSNT portion,
as it is no longer needed.
* src/process.c (waitpid, WUNTRACED) [!WNOHANG]: Remove definitions,
no longer needed.
(record_child_status_change): Remove the setting of
record_at_most_one_child for the !WNOHANG case.

2012-11-03  Paul Eggert  <eggert@cs.ucla.edu>

Fix a race condition that causes Emacs to mess up glib (Bug#8855).
This is a backport from the trunk.
The symptom is a diagnostic "GLib-WARNING **: In call to
g_spawn_sync(), exit status of a child process was requested but
SIGCHLD action was set to SIG_IGN and ECHILD was received by
waitpid(), so exit status can't be returned."  The diagnostic
is partly wrong, as the SIGCHLD action is not set to SIG_IGN.
The real bug is a race condition between Emacs and glib: Emacs
does a waitpid (-1, ...) and reaps glib's subprocess by mistake,
so that glib can't find it.  Work around the bug by invoking
waitpid only on subprocesses that Emacs itself creates.
* src/process.c (create_process, record_child_status_change):
Don't use special value -1 in pid field, as the caller now must
know the pid rather than having the callee infer it.  The
inference was sometimes incorrect anyway, due to another race.
(create_process): Set new 'alive' member if child is created.
(process_status_retrieved): New function.
(record_child_status_change): Use it.
Accept negative 1st argument, which means to wait for the
processes that Emacs already knows about.  Move special-case code
for DOS_NT (which lacks WNOHANG) here, from caller.  Keep track of
processes that have already been waited for, by testing and
clearing new 'alive' member.
(CAN_HANDLE_MULTIPLE_CHILDREN): Remove, as record_child_status_change
now does this internally.
(handle_child_signal): Let record_child_status_change do all
the work, since we do not want to reap all exited child processes,
only the child processes that Emacs itself created.
* src/process.h (Lisp_Process): New boolean member 'alive'.
2012-11-23 14:20:31 -08:00
admin merge trunk 2012-10-14 17:06:11 +09:00
autogen Auto-commit of generated files. 2012-11-21 07:17:28 -05:00
build-aux Merge from gnulib. 2012-05-26 16:14:36 -07:00
doc Correct and reword recent changes to window.texi. 2012-11-23 15:39:07 +01:00
etc Backport: Rename cygwin_convert_path* to cygwin_convert_file_name* 2012-11-20 11:28:53 -08:00
info Only ignore info/*.info 2012-05-05 11:40:49 +02:00
leim leim/quail/hebrew.el ("yiddish-royal"): Fix several bogus entries. 2012-09-05 21:05:16 +03:00
lib Spelling fixes. 2012-10-04 22:57:24 -07:00
lib-src * Makefile.in (uninstall): No INSTALLABLES live in archlibdir. 2012-10-26 00:40:51 -07:00
lisp * lisp/emacs-lisp/bytecomp.el (byte-compile-file): Setup default value for 2012-11-23 16:49:13 -05:00
lwlib Let configure set ar and associated flags 2012-10-05 20:42:28 -04:00
m4 Merge from gnulib. 2012-10-04 00:15:42 -07:00
msdos Adapt the MSDOS build to the latest changes on mainline. 2012-11-03 15:48:33 +02:00
nextstep Reduce the number of versioned files storing the short copyright string 2012-09-16 17:56:08 -07:00
nt Fix a race condition with glib (Bug#8855). 2012-11-23 14:20:31 -08:00
oldXMenu Let configure set ar and associated flags 2012-10-05 20:42:28 -04:00
src Fix a race condition with glib (Bug#8855). 2012-11-23 14:20:31 -08:00
test * lisp/progmodes/ruby-mode.el (ruby-move-to-block): When moving 2012-11-12 05:11:06 +04:00
.dir-locals.el Fix typo in previous 2012-07-09 15:56:14 -04:00
.gitignore .gitignore: Add compile, config.guess, config.sub, depcomp, 2011-03-25 15:06:41 +01:00
autogen.sh * Makefile.in: Run autogen/copy_autogen if autogen.sh fails, 2012-09-17 15:35:28 -07:00
BUGS Use C-h r in BUGS 2012-05-21 20:28:12 -07:00
ChangeLog * configure.ac (--enable-profiling): Doc fix. 2012-11-20 20:22:09 -05:00
config.bat Adapt the MSDOS build to the latest changes on mainline. 2012-11-03 15:48:33 +02:00
configure.ac * configure.ac (--enable-profiling): Doc fix. 2012-11-20 20:22:09 -05:00
COPYING Restore files that I seem to have mistakenly deleted. 2010-12-03 14:45:09 +00:00
GNUmakefile Adapt the MSDOS build to the latest changes on mainline. 2012-11-03 15:48:33 +02:00
INSTALL Improve robustness of 'make bootstrap'. 2012-09-09 18:03:27 -07:00
INSTALL.BZR Defer to configure.ac for required automake version 2012-08-07 13:02:30 -04:00
make-dist Fix typo in previous 2012-09-17 15:53:27 -04:00
Makefile.in * Makefile.in (EMACS_NAME): New variable. 2012-10-26 14:35:36 -04:00
README Improve robustness of 'make bootstrap'. 2012-09-09 18:03:27 -07:00

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

Copyright (C) 2001-2012  Free Software Foundation, Inc.
See the end of the file for license conditions.


This directory tree holds version 24.2.50 of GNU Emacs, the extensible,
customizable, self-documenting real-time display editor.

The file INSTALL in this directory says how to build and install GNU
Emacs on various systems, once you have unpacked or checked out the
entire Emacs file tree.

See the file etc/NEWS for information on new features and other
user-visible changes in recent versions of Emacs.

The file etc/PROBLEMS contains information on many common problems that
occur in building, installing and running Emacs.

You may encounter bugs in this release.  If you do, please report
them; your bug reports are valuable contributions to the FSF, since
they allow us to notice and fix problems on machines we don't have, or
in code we don't use often.  Please send bug reports to the mailing
list bug-gnu-emacs@gnu.org.  If possible, use M-x report-emacs-bug.

See the "Bugs" section of the Emacs manual for more information on how
to report bugs.  (The file `BUGS' in this directory explains how you
can find and read that section using the Info files that come with
Emacs.)  See `etc/MAILINGLISTS' for more information on mailing lists
relating to GNU packages.

The `etc' subdirectory contains several other files, named in capital
letters, which you might consider looking at when installing GNU
Emacs.

The file `configure' is a shell script to acclimate Emacs to the
oddities of your processor and operating system.  It creates the file
`Makefile' (a script for the `make' program), which automates the
process of building and installing Emacs.  See INSTALL for more
detailed information.

The file `configure.ac' is the input used by the autoconf program to
construct the `configure' script.  Since Emacs has some configuration
requirements that autoconf can't meet directly, and for historical
reasons, `configure.ac' uses an unholy marriage of custom-baked
configuration code and autoconf macros.

The shell script `autogen.sh' generates 'configure' and other files by
running the GNU build tools autoconf and automake, which in turn use
GNU m4 and Perl.  If you want to use it, you will need to install
recent versions of these build tools.  This should be needed only if
you edit files like `configure.ac' that specify Emacs's autobuild
procedure.

The file `Makefile.in' is a template used by `configure' to create
`Makefile'.

The file `make-dist' is a shell script to build a distribution tar
file from the current Emacs tree, containing only those files
appropriate for distribution.  If you make extensive changes to Emacs,
this script will help you distribute your version to others.

There are several subdirectories:

`src'       holds the C code for Emacs (the Emacs Lisp interpreter and
            its primitives, the redisplay code, and some basic editing
            functions).
`lisp'      holds the Emacs Lisp code for Emacs (most everything else).
`leim'      holds the library of Emacs input methods, Lisp code and
            auxiliary data files required to type international characters
            which can't be directly produced by your keyboard.
`lib'       holds source code for libraries used by Emacs and its utilities
`lib-src'   holds the source code for some utility programs for use by or
            with Emacs, like movemail and etags.
`etc'       holds miscellaneous architecture-independent data files Emacs
            uses, like the tutorial text and tool bar images.
            The contents of the `lisp', `leim', `info', and `doc'
            subdirectories are architecture-independent too.
`info'      holds the Info documentation tree for Emacs.
`doc/emacs' holds the source code for the Emacs Manual.  If you modify the
            manual sources, you will need the `makeinfo' program to produce
            an updated manual.  `makeinfo' is part of the GNU Texinfo
            package; you need a suitably recent version of Texinfo.
`doc/lispref'   holds the source code for the Emacs Lisp reference manual.
`doc/lispintro' holds the source code for the Introduction to Programming
                in Emacs Lisp manual.
`msdos'     holds configuration files for compiling Emacs under MSDOG.
`nextstep'  holds instructions and some other files for compiling the
            Nextstep port of Emacs, for GNUstep and Mac OS X Cocoa.
`nt'        holds various command files and documentation files that pertain
            to building and running Emacs on Windows 9X/ME/NT/2000/XP.
`test'      holds tests for various aspects of Emacs's functionality.

   Building Emacs on non-Posix platforms requires tools that aren't part
of the standard distribution of the OS.  The platform-specific README
files and installation instructions should list the required tools.


NOTE ON COPYRIGHT YEARS

In copyright notices where the copyright holder is the Free Software
Foundation, then where a range of years appears, this is an inclusive
range that applies to every year in the range.  For example: 2005-2008
represents the years 2005, 2006, 2007, and 2008.


This file is part of GNU Emacs.

GNU Emacs 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.

GNU Emacs 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 GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.