ridiculousfish
b0e09303a6
Reintroduce "Stop reaping children from SIGCHLD handler"
...
This re-introduces 3fe1069219
with some associated fixes to address #1768 .
2014-10-25 16:51:25 -07:00
ridiculousfish
315ff1e712
Revert "Stop reaping children from SIGCHLD signal handler"
...
This reverts commit 3fe1069219
.
In light of #1768
2014-10-21 11:33:22 -07:00
ridiculousfish
3fe1069219
Stop reaping children from SIGCHLD signal handler
...
Prior to this fix, a child process may be reaped in one of two ways:
1. By a call to waitpid() within job_continue
2. By a call to waitpid() within the SIGCHLD signal handler
Only the second call was with the WNOHANG option. Thus if the signal
handler fired first, and then the waitpid call fired, we could get a
deadlock because we'd end up waiting on a long-running process. I have
not been able to reproduce this on fish 1.x, though it seems like it
ought to reproduce there too.
This fix migrates the waitpid() call out of the signal handler; the
second class of calls moves to job_reap. This eliminates the possibility
of a race, because we check for job completion before calling waitpid,
and there is no longer the possibility of the job being marked as
complete asynchronously. It also results in a massive conceptual
simplification, since the signal handler is now very simple and easy to
reason about (no more walking jobs lists, etc).
This partially fixes a bug reported in #1273
2014-10-20 15:50:54 -07:00
Kevin Ballard
4568359e27
Remove some obsolete job flags
...
These flags were used by the old parser, but not by the new one.
2014-10-13 18:33:55 -07:00
Kevin Ballard
489fb7ec3f
Expunge INTERNAL_BLOCK from the codebase
...
It's a relic of the old parser, and isn't used anymore.
2014-09-30 17:20:46 -07:00
ridiculousfish
e5aa06991e
Remove INTERNAL_BUFFER, which was only used by fish_pager
2014-09-22 10:16:16 -07:00
ridiculousfish
53814983ff
Update style and formatting to conform to fish style guide.
2014-01-15 01:40:40 -08:00
ridiculousfish
6ce4b344e4
Hook up for statements, if statements, and function definition in new
...
parser
2013-12-27 01:38:43 -08:00
ridiculousfish
924b8cbe24
New ideas about how to use new parser for execution. Beginnings of
...
implementation.
2013-12-26 12:24:00 -08:00
ridiculousfish
739e529416
Initial flailing around trying to adopt new parser for actual execution
2013-12-20 14:37:40 -08:00
ridiculousfish
964c7e6f3b
Merge branch 'master' into ast
...
Conflicts:
complete.cpp
2013-10-27 13:37:14 -07:00
ridiculousfish
cf766b55cc
Fix formatting
2013-10-26 15:27:39 -07:00
ridiculousfish
dd91779442
Merge branch 'master' into ast_no_templates
...
Conflicts:
configure.ac
exec.cpp
2013-10-06 13:08:57 -07:00
ridiculousfish
4899086b3c
Big fat refactoring of how redirections work. In fish 1.x and 2.0.0, the redirections for a process were flattened into a big list associated with the job, so there was no way to tell which redirections applied to each process. Each process therefore got all the redirections associated with the job. See https://github.com/fish-shell/fish-shell/issues/877 for how this could manifest.
...
With this change, jobs only track their block-level redirections. Process level redirections are correctly associated with the process, and at exec time we stitch them together (block, pipe, and process redirects).
This fixes the weird issues where redirects bleed across pipelines (like #877 ), and also allows us to play with the order in which redirections are applied, since the final list is constructed right before it's needed. This lets us put pipes after block level redirections but before process level redirections, so that a 2>&1-type redirection gets picked up after the pipe, i.e. it should fix https://github.com/fish-shell/fish-shell/issues/110
This is a significant change. The tests all pass. Cross your fingers.
2013-08-19 18:06:24 -07:00
ridiculousfish
e849beabba
Initial work towards various IO cleanups with an eye to fixing https://github.com/fish-shell/fish-shell/issues/110
2013-08-19 18:06:24 -07:00
ridiculousfish
66af0c1a53
More work on the AST. block statements worked out a bit more.
2013-06-24 12:33:40 -07:00
ridiculousfish
5d75ee7721
Mark jobs as completed when all processes have finished, not just the last one.
...
Fixes https://github.com/fish-shell/fish-shell/issues/876 , and coincidentally also https://github.com/fish-shell/fish-shell/issues/848
2013-06-16 02:53:53 -07:00
Cheer Xiao
e411bac592
Fix comments in proc.h (spelling, wording, format)
2013-02-03 09:33:26 +08:00
ridiculousfish
1879dc4b59
Initial set of changes working to make fish robust against running out of file descriptors
2013-01-30 02:22:38 -08:00
Cheer Xiao
8f045b9ec5
Fix spelling: s/circut/circuit/g
2013-01-24 19:20:06 +08:00
ridiculousfish
9992b8eb0e
Apply new indentation, brace, and whitespace style
2012-11-18 16:30:30 -08:00
Łukasz Niemier
47df1ae40a
Remove trailing whitespaces and change tabs to spaces
2012-11-18 11:23:22 +01:00
ridiculousfish
425afa63ce
Don't use posix_spawn when file redirections are involved (except /dev/null) because the error handling is too difficult
...
Fix exec to correctly handle the case where a pid could not be created due to posix_spawn failing
Should fix https://github.com/fish-shell/fish-shell/issues/364
2012-10-29 01:45:51 -07:00
ridiculousfish
cc1395797e
First stab at elseif implementation
2012-09-01 01:46:14 -07:00
ridiculousfish
61686aff34
Adopt posix_spawn (!)
...
Rewrite IO chains to be a vector of pointers, instead of a linked list
Removed io_transmogrify
2012-08-15 00:57:56 -07:00
ridiculousfish
84729c4dfa
Additional warnings cleanup, effective C++ violations, dead code removal
2012-08-05 13:24:33 -07:00
ridiculousfish
b08fb86637
Renamed env_vars to env_vars_snapshot_t
...
Cleanup of non-wcstring version of path_get_path
2012-07-20 20:39:31 -07:00
ridiculousfish
69446be1ee
Signal handling cleanup and improved safety
...
Fixes issue where you couldn't control-C out of a loop (https://github.com/ridiculousfish/fishfish/issues/13 )
Also stops doing memory allocation in the signal handler (oops) https://github.com/ridiculousfish/fishfish/issues/27
2012-06-04 14:20:01 -07:00
ridiculousfish
268fb37517
Cleanup proc_had_barrier
...
Ensure we don't try to do a universal barrier off of the main thread
2012-03-31 15:33:34 -07:00
ridiculousfish
d173bb6e0a
A bunch of changes working towards eliminating all memory allocation after fork()
2012-03-08 23:21:07 -08:00
ridiculousfish
8ada404c5f
More work towards improving relationship between multithreading and fork
2012-02-29 16:14:51 -08:00
ridiculousfish
ebba30d671
Fix a "class <-> struct" warning with clang++
2012-02-29 16:14:51 -08:00
ridiculousfish
909d24cde6
More work on improving interaction between fork and pthreads. Added null_terminated_array_t class.
2012-02-29 16:14:51 -08:00
ridiculousfish
fdfa5c0602
Some initial work towards resolving nasty fork/pthread issues, and to having a per-parser job list
2012-02-27 18:43:24 -08:00
ridiculousfish
38e40862fe
More work towards autosuggesting completions
2012-02-25 18:54:49 -08:00
ridiculousfish
a08450bcb6
Changes to make autosuggestion smarter about not suggesting commands that could never succeed.
2012-02-16 00:24:27 -08:00
ridiculousfish
e5ff5f7484
Some hopefully good changes to get IOs off of halloc
2012-02-09 18:43:36 -08:00
ridiculousfish
beece6a828
Clean up how argv is stored in process_t
2012-01-31 18:06:20 -08:00
Siteshwar Vashisht
f988dcd6f9
Fixed compilation errors caused by latest commits
2012-01-30 21:45:02 +05:30
ridiculousfish
316f81119f
Excised some more halloc
2012-01-29 23:22:42 -08:00
ridiculousfish
3b8a4e56b0
A bunch of work to move towards a sane memory model in job_t
2012-01-29 22:06:58 -08:00
ridiculousfish
966cd6a8ca
Began migration of job_t away from halloc
2012-01-29 18:25:54 -08:00
ridiculousfish
f243cd86c9
Convert jobs list to std::list
2012-01-29 16:36:21 -08:00
Peter Ammon
9b133a978d
Improve const and signed/unsigned correctness
2012-01-14 22:32:45 -08:00
ridiculousfish
8d2f107d61
Some changes to migrate towards C++ and a multithreaded model
2011-12-26 19:18:46 -08:00
Grissiom
c6372a1b3f
remove trailing spaces
...
This is done by `sed -i -e 's/[ \t]*$//' *.[c,h]`, which should not
introduce any functionality change.
2010-09-18 09:51:16 +08:00
axel
f5be301a2f
Handle exit status of processes terminated by signals
...
darcs-hash:20090221164656-ac50b-7bcbf6cb0bb8384560fbf9bf1059480cb4089def.gz
2009-02-22 02:46:56 +10:00
liljencrantz
394776c56b
Update todo list and code comments
...
darcs-hash:20080109012338-75c98-745297861fd11ec82e062a79fe1d15c9084342f1.gz
2008-01-09 11:23:38 +10:00
liljencrantz
71c2cde390
Cleanup and improve the exit status numbers and the messages generated on error as well as make sure that keyboard shortcuts don't change the status
...
darcs-hash:20080108193145-75c98-56c8aa2dd081af643d206820aa36bf3b6e49e0f2.gz
2008-01-09 05:31:45 +10:00
axel
91de143003
Replace the count function with a builtin for performance reasons. The count function used at least two forks, which was noticable on systems such as OS X with slow forks
...
darcs-hash:20070731212332-ac50b-8f5b2e70008ddb131dc8bae3f361d8d65a294948.gz
2007-08-01 07:23:32 +10:00