#endif
return false;
}
+
+static int open4read(const char const *path)
+{
+ return open(path, O_RDONLY | O_BINARY);
+}
+
/*
* add_file:
* Add a file to the file list.
#ifdef _WIN32
(!isdir) &&
#endif
- ((fd = open(path, O_RDONLY | O_BINARY)) < 0)) ||
+ ((fd = open4read(path)) < 0)) ||
!path_is_absolute(path))
{
debugprint("sarahhhhh fd=%d path=<%s> dir=<%s> file=<%s> percent=%d\n",
return;
if (!(fp->child))
{
- if ((fd = open(fp->datfile, O_RDONLY | O_BINARY)) < 0)
+ if ((fd = open4read(fp->datfile)) < 0)
{
perror(fp->datfile);
exit(1);
*/
static void open_dat(FILEDESC *fp)
{
- if (fp->datfd < 0 &&
- (fp->datfd = open(fp->datfile, O_RDONLY | O_BINARY)) < 0)
+ if (fp->datfd < 0 && (fp->datfd = open4read(fp->datfile)) < 0)
{
exit(1);
}