summaryrefslogtreecommitdiff
path: root/src/build.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/build.cc')
-rw-r--r--src/build.cc25
1 files changed, 16 insertions, 9 deletions
diff --git a/src/build.cc b/src/build.cc
index 1b70c5b..425ccd3 100644
--- a/src/build.cc
+++ b/src/build.cc
@@ -78,16 +78,19 @@ int build(const Settings& settings,
process != processes.end();
++process)
{
- if(process->valid())
+ if(process->valid() == false)
{
- if(process->get() != 0)
- {
- // TODO: Wait for other processes to finish before returning
- return 1;
- }
- processes.erase(process);
- break;
+ continue;
+ }
+
+ auto ret = process->get();
+ if(ret != 0)
+ {
+ // NOTE Wait for other processes to finish before returning
+ return ret;
}
+ processes.erase(process);
+ break;
}
if(started_one)
@@ -104,11 +107,15 @@ int build(const Settings& settings,
process != processes.end();
++process)
{
+ if(process->valid() == false)
+ {
+ continue;
+ }
process->wait();
auto ret = process->get();
if(ret != 0)
{
- return 1;
+ return ret;
}
}