Code redundancies: spawning processes/pipe handling
Maciek Plewa <[email protected]>
| Newsgroups | gmane.comp.gnu.dotgnu.developer |
|---|---|
| Message-ID | <[email protected]> |
I'm currently porting PNet to MinGW (and hopefully VC++ in near future) and found some possibly reduntant code. In both cscc/common/cc_main.c and support/spawn.c there's very similar (if not identical) code for spawning processes and handling their pipes. Would it be OK to throw out the code from cc_main.c and refer to spawn.c instead? I've used some code from GNU CVS (+ trivial waitpid implementation) to handle process spawning and stdout->pipe redirection, but the code is slightly bloated, I'll probably implement my own solution. AFAIK except for the above, and various waitpid calls around Pnet, there are no further portability issues, are there? Also, I had to rename the function LoadLibrary in cscc/common/cc_main.c to LoadLibraryCodeGen, as it was conflicting with an existing Win32 library. This function is internal (and wrapped with CCLoadLibrary) so it shouldn't create any API problems. PS. You've gotta love the terminology: 'forking children with pipes' :) -- Maciek Plewa Military Research and Simulations Initiative http://mil-sim.net/contact