Only -1 returned by open() means "unsuccessful completion"
Coverity CID 1034535, CID 1127333
We will leak descriptor after goto
Coverity CID 1127332, CID 1127333