| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
POSIX shells set the exit code to 128 + the signal number, which
coincidentally matches the layout used by the WIFSIGNALLED/WTERMSIG
macros on most Unix-like systems, but not on AIX. Instead, AIX stores
the signal value in the bottom 8 bits and also bits 16-23. The only time
ninja currently handles signals correctly is when the shell used to call
the program dies via signal.
To handle both scenarios, we detect the shell exit code format and
convert it to the format that the WIFSIGNALED/WTERMSIG macros expect.
Fixes #1623
|
|
|
|
| |
header files
|
|
|
|
|
| |
pselect() is in sys/select.h in "newer" (2001) versions of posix, so add an include for it.
While here, only include poll.h if USE_PPOLL is defined.
|
|\
| |
| | |
Two fixes for NetBSD
|
| | |
|
|/ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Non-console subprocesses have the write end of a pipe connected to fds
1 and 2 for stdout and stderr, but they also have the it connected to
whatever fd was assigned in the ninja process when the pipe was
created. Add a call to posix_spawn_file_actions_addclose after
the posix_spawn_file_actions_adddup2 calls to close the original fd
once it has been dup'd to stdout and stderr.
This fixes an issue seen in the Android build, where one of the
subprocesses is used to start a background helper process. The
background process attempts to close any inherited fds, but if ninja
used a very large fd number due to a high parallelism count the
background process would not close the fd and ninja would never
consider the subprocess finished.
|
|
|
|
|
|
|
|
| |
Existing comments were alluding to it's usage and it makes building
ninja itself go a litle bit faster (i.e. taking less wall clock time).
FWIW FreeBSD even uses vfork by default c.f.
https://www.freebsd.org/cgi/man.cgi?query=posix_spawn
|
|
|
|
|
| |
posix_spawn() is a syscall on OS X and Solaris and a bit faster. It's
also easier emulate for cygwin, and the code is a bit simpler.
|
|
|
|
|
|
|
|
|
|
|
| |
The change caused some issues (it makes it impossible ot use
posix_spawn() and makes it harder to suspend children on ctrl-z). After
discussing with jln: Since it fixes a corner case that can be fixed by
explicitly running commands that need it in a wrapper that setsid()s
them, let's try reverting it for a while. Please shout if this is a
problem for you.
See also #1097.
|
|
|
|
|
| |
SIGHUP is sent when the connection hang up (i.e. when the terminal
window is closed or the ssh connection is closed).
|
| |
|
|
|
|
|
| |
Default signal sent by many other programs (mainly kill(1)) to gently
terminates another one is SIGTERM.
|
|
|
|
|
|
|
|
| |
Put background subprocesses (i.e. subprocesses with no access
to the console) in their own session and detach them from the
terminal.
This fixes martine/ninja#909.
|
|
|
|
|
|
|
|
|
| |
ppoll/pselect prioritizes file descriptor events over
a signal delivery. So a flood of events prevents ninja
from reacting keyboard interruption by the user.
This CL adds a check for pending keyboard interruptions after
file descriptor events.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
| |
This is a pre-defined pool with a depth of 1. It has the special property
that any task in the pool has direct access to the console. This can be
useful for interactive tasks or long-running tasks which produce status
updates on the console (such as test suites).
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
All modern Linux kernels have ppoll() but sometimes
you might want to compile on something ancient.
This patch adds the possibility to force the use
of pselect() instead by passing --force-pselect
to bootstrap/configure.
The use of ppoll() is still default for Linux
and OpenBSD
|
| |
|
|
|
|
|
|
| |
POLLRDHUP is Linux-specific, and isn't necessary for polling pipes
anyway. Linux and OpenBSD both return POLLHUP if no process has the
pipe open for writing.
|
|
|
|
|
|
| |
Use ppoll() on OpenBSD. Also, fix interrupt handling to recognize
that on FreeBSD and OpenBSD, an interrupt might have been delivered
even if pselect()/ppoll() don't return -1/EINTR.
|
|
|
|
| |
Fixes issue #468.
|
|
|