Add output flushing before fork()