I'm programming in a win32 enviornment using Visual C++. My problem is that I have a program which uses the system() call on itself (argv) to spawn the same program on error, but the other first program does not reach return -1; which causes it to stay open with the second one open at the same time. Then the second one opens a third one, leaving the first and second. So it leaves an infinite train of processes open. Is there any way around this?