Commit next part of FS#10138 by Teruaki Kawashima. Fixes check for open error in...