--- libaitio/src/exec.c 2013/12/12 21:17:53 1.1.2.18 +++ libaitio/src/exec.c 2013/12/12 21:59:01 1.1.2.19 @@ -254,6 +254,7 @@ io_progOpen(prog_t * __restrict prg, u_int execNum) pthread_mutex_lock(&prg->prog_mtx); for (i = 0; (execNum ? ret < execNum : 42) && i < array_Size(prg->prog_fds); i++) if (!array_Get(prg->prog_fds, i)) { + printf("%d) %s!!! %d ret=%d\n", i, __func__, execNum, ret); f = e_popen(prg->prog_name, "r+", &pid); #ifdef POPEN_STREAM if (!f) { @@ -302,7 +303,7 @@ io_progGrow(prog_t * __restrict prg, u_int toNum) if (toNum < prg->prog_inin) toNum = prg->prog_inin; - if ((toNum - prg->prog_cnum) < 1) + if ((int) (toNum - prg->prog_cnum) < 1) return 0; return io_progOpen(prg, toNum - prg->prog_cnum); @@ -397,7 +398,7 @@ io_progCheck(prog_t * __restrict prg, int re) pthread_mutex_unlock(&prg->prog_mtx); /* resurrect to init number */ - if (re && prg->prog_inin - prg->prog_cnum) + if (re && ((int) (prg->prog_inin - prg->prog_cnum) > 0)) io_progOpen(prg, prg->prog_inin - prg->prog_cnum); return ret; @@ -444,7 +445,7 @@ io_progAttach(prog_t * __restrict prg, int newOne) } pthread_mutex_unlock(&prg->prog_mtx); - /* not found free prog */ + /* not found free program */ if (!f && (i = io_progOpen2(prg)) > 0) { #ifdef POPEN_STREAM f = array(prg->prog_fds, i, FILE*);