We break the read while loop after waiting "the end of the process" and the pipes are empty, otherwise we do another select that waits all the timeout.