The conditions were ORed before, which typically made the load limit be
ignored since the jobs limit was satisfied.
Also, -l 0 makes little sense, so don't really wait for the load to become
lower than 0 in that case.
* Cap sillyness. Closes: #570815
* parallel: Fix exit code handling when commands are specified after --
* parallel: Make -j 0 do something reasonable (start all jobs at once).
+ * parallel: Fix to really avoid running new jobs when load is too high.
-- Joey Hess <joeyh@debian.org> Sun, 21 Feb 2010 13:16:10 -0500
getloadavg(&load, 1);
- if ((maxjobs == 0 || curjobs < maxjobs) ||
- (maxload > 0 && load < maxload)) {
+ if ((maxjobs == 0 || curjobs < maxjobs) &&
+ (maxload <= 0 || load < maxload)) {
+
if (argsatonce > arglen - argidx)
argsatonce = arglen - argidx;
exec_child(command, arguments + argidx,