aboutsummaryrefslogtreecommitdiffhomepage
path: root/proc.cpp
diff options
context:
space:
mode:
authorGravatar ridiculousfish <corydoras@ridiculousfish.com>2012-10-29 01:45:51 -0700
committerGravatar ridiculousfish <corydoras@ridiculousfish.com>2012-10-29 01:45:51 -0700
commit425afa63cec7015cbffb170c52ff32fc78a24ce7 (patch)
tree29dbf7ec3d2b79d997e91e9d668d365455e0b84f /proc.cpp
parent7c09a767b6031720cb07505375cf8a6863fe1268 (diff)
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
Diffstat (limited to 'proc.cpp')
-rw-r--r--proc.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/proc.cpp b/proc.cpp
index 59d64ee9..b61baf59 100644
--- a/proc.cpp
+++ b/proc.cpp
@@ -388,6 +388,12 @@ static void mark_process_status( const job_t *j,
}
}
+void job_mark_process_as_failed( const job_t *job, process_t *p )
+{
+ /* The given process failed to even lift off (e.g. posix_spawn failed) and so doesn't have a valid pid. Mark it as dead. */
+ p->completed = 1;
+}
+
/**
Handle status update for child \c pid. This function is called by
the signal handler, so it mustn't use malloc or any such hitech