import patch from bugID 190160, see https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=190160