This should not really fail, but let's check return value anyway as it guards against future changes. Coverity 1135731