Lines 21-31
__multijob_init() {
Link Here
|
21 |
# Setup a pipe for children to write their pids to when they finish. |
21 |
# Setup a pipe for children to write their pids to when they finish. |
22 |
# We have to allocate two fd's because POSIX has undefined behavior |
22 |
# We have to allocate two fd's because POSIX has undefined behavior |
23 |
# when you open a FIFO for simultaneous read/write. #487056 |
23 |
# when you open a FIFO for simultaneous read/write. #487056 |
|
|
24 |
# And Cygwin supports just one read/write fd at once. #583962 |
24 |
local pipe=$(mktemp -t multijob.XXXXXX) |
25 |
local pipe=$(mktemp -t multijob.XXXXXX) |
25 |
rm -f "${pipe}" |
26 |
rm -f "${pipe}" |
26 |
mkfifo -m 600 "${pipe}" |
27 |
mkfifo -m 600 "${pipe}" |
27 |
__redirect_alloc_fd mj_write_fd "${pipe}" |
|
|
28 |
__redirect_alloc_fd mj_read_fd "${pipe}" |
28 |
__redirect_alloc_fd mj_read_fd "${pipe}" |
|
|
29 |
__redirect_alloc_fd mj_write_fd "${pipe}" '>' |
29 |
rm -f "${pipe}" |
30 |
rm -f "${pipe}" |
30 |
|
31 |
|
31 |
# See how many children we can fork based on the user's settings. |
32 |
# See how many children we can fork based on the user's settings. |
32 |
- |
|
|