summaryrefslogtreecommitdiffstats
path: root/src/util/db2/recno/rec_open.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/util/db2/recno/rec_open.c')
-rw-r--r--src/util/db2/recno/rec_open.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/util/db2/recno/rec_open.c b/src/util/db2/recno/rec_open.c
index fccaacc90..f18a1cb02 100644
--- a/src/util/db2/recno/rec_open.c
+++ b/src/util/db2/recno/rec_open.c
@@ -68,7 +68,7 @@ __rec_open(fname, flags, mode, openinfo, dflags)
int rfd, sverrno;
/* Open the user's file -- if this fails, we're done. */
- if (fname != NULL && (rfd = open(fname, flags, mode)) < 0)
+ if (fname != NULL && (rfd = open(fname, flags | O_BINARY, mode)) < 0)
return (NULL);
/* Create a btree in memory (backed by disk). */
@@ -85,9 +85,9 @@ __rec_open(fname, flags, mode, openinfo, dflags)
btopeninfo.prefix = NULL;
btopeninfo.lorder = openinfo->lorder;
dbp = __bt_open(openinfo->bfname,
- O_RDWR, S_IRUSR | S_IWUSR, &btopeninfo, dflags);
+ O_RDWR | O_BINARY, S_IRUSR | S_IWUSR, &btopeninfo, dflags);
} else
- dbp = __bt_open(NULL, O_RDWR, S_IRUSR | S_IWUSR, NULL, dflags);
+ dbp = __bt_open(NULL, O_RDWR | O_BINARY, S_IRUSR | S_IWUSR, NULL, dflags);
if (dbp == NULL)
goto err;
@@ -130,7 +130,7 @@ __rec_open(fname, flags, mode, openinfo, dflags)
default:
goto einval;
}
-slow: if ((t->bt_rfp = fdopen(rfd, "r")) == NULL)
+slow: if ((t->bt_rfp = fdopen(rfd, "rb")) == NULL)
goto err;
F_SET(t, R_CLOSEFP);
t->bt_irec =