Fix an incorrect error check detected by the GCC analyzer
The return value of open(2) should be compared with -1 to check for an error but it was compared with 0 instead.
The return value of open(2) should be compared with -1 to check for an error but it was compared with 0 instead.