aboutsummaryrefslogtreecommitdiffhomepage
path: root/proc.cpp
diff options
context:
space:
mode:
authorGravatar ridiculousfish <corydoras@ridiculousfish.com>2012-11-04 15:45:52 -0800
committerGravatar ridiculousfish <corydoras@ridiculousfish.com>2012-11-04 15:45:52 -0800
commit5e371e8fe7cbdecd87678d50d06c12851213776e (patch)
treeb20fc6e456745d7f1016d02ee750101b365185ed /proc.cpp
parente46324ced9a6e1fa79ffbd56dfed652a3180b0ca (diff)
Don't use posix_spawn for commands that need to be put into foreground to avoid a race
Fix for race where a command's output may not be fully drained
Diffstat (limited to 'proc.cpp')
-rw-r--r--proc.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/proc.cpp b/proc.cpp
index b61baf59..6fc5e500 100644
--- a/proc.cpp
+++ b/proc.cpp
@@ -1110,14 +1110,6 @@ void job_continue (job_t *j, int cont)
}
while (got_signal && !quit);
- if (quit) {
- // It's possible that the job will produce output and exit before we've even read from it.
- // We'll eventually read the output, but it may be after we've executed subsequent calls
- // This is why my prompt colors kept getting screwed up - the builtin echo calls
- // were sometimes having their output combined with the set_color calls in the wrong order!
- read_try(j);
- }
-
if( !quit )
{
@@ -1175,6 +1167,14 @@ void job_continue (job_t *j, int cont)
if( job_is_completed( j ))
{
+
+ // It's possible that the job will produce output and exit before we've even read from it.
+ // We'll eventually read the output, but it may be after we've executed subsequent calls
+ // This is why my prompt colors kept getting screwed up - the builtin echo calls
+ // were sometimes having their output combined with the set_color calls in the wrong order!
+ read_try(j);
+
+
process_t *p = j->first_process;
while( p->next )
p = p->next;