Adapt wait-tcp for mac