fd = open(fname, O_RDONLY | PG_BINARY, 0);
if (fd < 0 && errno != ENOENT)
return -1;
- else if (fd > 0)
+ else if (fd >= 0)
return fd;
/* XLOGDIR / fname */
fd = open(fpath, O_RDONLY | PG_BINARY, 0);
if (fd < 0 && errno != ENOENT)
return -1;
- else if (fd > 0)
+ else if (fd >= 0)
return fd;
datadir = getenv("PGDATA");
fd = open(fpath, O_RDONLY | PG_BINARY, 0);
if (fd < 0 && errno != ENOENT)
return -1;
- else if (fd > 0)
+ else if (fd >= 0)
return fd;
}
}
fd = open(fpath, O_RDONLY | PG_BINARY, 0);
if (fd < 0 && errno != ENOENT)
return -1;
- else if (fd > 0)
+ else if (fd >= 0)
return fd;
/* directory / XLOGDIR / fname */
fd = open(fpath, O_RDONLY | PG_BINARY, 0);
if (fd < 0 && errno != ENOENT)
return -1;
- else if (fd > 0)
+ else if (fd >= 0)
return fd;
}
return -1;