* Runs a child process and blocks until it returns. Arguments as follows: * * cmd = Command line to run. * state = Expected return value of kwsysProcess_GetState after exit. * exception = Expected return value of kwsysProcess_GetExitException. * value = Expected return value of kwsysProcess_GetExitValue. * share = Whether to share stdout/stderr chi
| 544 | * detachment occurs. |
| 545 | */ |
| 546 | int runChild(char const* cmd[], int state, int exception, int value, int share, |
| 547 | int output, int delay, double timeout, int poll, int repeat, |
| 548 | int disown, int createNewGroup, unsigned int interruptDelay) |
| 549 | { |
| 550 | int result = 1; |
| 551 | kwsysProcess* kp = kwsysProcess_New(); |
| 552 | if (!kp) { |
| 553 | fprintf(stderr, "kwsysProcess_New returned NULL!\n"); |
| 554 | return 1; |
| 555 | } |
| 556 | while (repeat-- > 0) { |
| 557 | result = runChild2(kp, cmd, state, exception, value, share, output, delay, |
| 558 | timeout, poll, disown, createNewGroup, interruptDelay); |
| 559 | if (result) { |
| 560 | break; |
| 561 | } |
| 562 | } |
| 563 | kwsysProcess_Delete(kp); |
| 564 | return result; |
| 565 | } |
| 566 | |
| 567 | int main(int argc, char const* argv[]) |
| 568 | { |