Bring in fix from FreeBSD/cperciva: