summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--batchd.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/batchd.c b/batchd.c
index 6fde5a8..ceb3911 100644
--- a/batchd.c
+++ b/batchd.c
@@ -13,7 +13,7 @@
#include <signal.h>
#define DEFAULT_QUEUE_DIR "."
-#define MAX_JOBS 1
+#define MAX_JOBS 2
int cur_jobs = 0;
@@ -74,11 +74,11 @@ wait_all()
{
for (;;) {
int r = waitpid(-1, NULL, WNOHANG);
- if (r == -1) {
+ if (r == 0)
+ break;
+ else if (r == -1) {
if (errno == ECHILD)
break;
- else if (errno == EWOULDBLOCK)
- break;
else
err(1, "waitpid()");
}