1 |
On Sun, Oct 30, 2005 at 12:06:10AM +0900, Jason Stubbs wrote: |
2 |
> + my_pipes = {} |
3 |
> + close_pipes = {} |
4 |
> + for x in fd_pipes: |
5 |
> + my_pipes[x] = os.dup(fd_pipes[x]) |
6 |
> + close_pipes[fd_pipes[x]] = True |
7 |
> + for x in close_pipes: |
8 |
> + os.close(x) |
9 |
> + for x in my_pipes: |
10 |
> + os.dup2(my_pipes[x], x) |
11 |
> + os.close(my_pipes[x]) |
12 |
|
13 |
Works for me- might be worth tracking what was closed to avoid trying |
14 |
to close those fd's during the "force all unused fd's closed" run, |
15 |
from a speed standpoint (less syscalls). |
16 |
~harring |