--- libaitio/src/exec.c 2013/12/08 20:57:32 1.1.2.15 +++ libaitio/src/exec.c 2013/12/08 21:11:54 1.1.2.16 @@ -347,6 +347,7 @@ io_progCheck(prog_t * __restrict prg, int re) * io_progAttach() - Attach to open program * * @prg = program pool + * @newOne = Execute new one program after attach * return: NULL error or !=NULL attached program handle */ #ifdef POPEN_STREAM @@ -354,7 +355,7 @@ FILE * #else int #endif -io_progAttach(prog_t * __restrict prg) +io_progAttach(prog_t * __restrict prg, int newOne) { #ifdef POPEN_STREAM FILE *f = NULL; @@ -382,6 +383,10 @@ io_progAttach(prog_t * __restrict prg) break; } pthread_mutex_unlock(&prg->prog_mtx); + + /* execute new one program */ + if (newOne && f) + io_progOpen(prg, 1); return f; }