diff options
author | Magnus Hagander <magnus@hagander.net> | 2008-09-24 08:59:42 +0000 |
---|---|---|
committer | Magnus Hagander <magnus@hagander.net> | 2008-09-24 08:59:42 +0000 |
commit | 607b7166d8c99ed42f26110f7ac2eee11d7b1fbf (patch) | |
tree | 7ac6a4bee3e2a180e16e22f1a1c7cde54364dab1 /src/bin/pg_resetxlog/pg_resetxlog.c | |
parent | cdf5357ec9ac3f3ef6d300ddf1651e572033c506 (diff) | |
download | postgresql-607b7166d8c99ed42f26110f7ac2eee11d7b1fbf.tar.gz postgresql-607b7166d8c99ed42f26110f7ac2eee11d7b1fbf.zip |
Make sure pg_control is opened in binary mode, to deal
with situtations when the file contains an EOF maker
(0x1A) on Windows.
ITAGAKI Takahiro
Diffstat (limited to 'src/bin/pg_resetxlog/pg_resetxlog.c')
-rw-r--r-- | src/bin/pg_resetxlog/pg_resetxlog.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/bin/pg_resetxlog/pg_resetxlog.c b/src/bin/pg_resetxlog/pg_resetxlog.c index c3cfafea7ae..c2db7bd9668 100644 --- a/src/bin/pg_resetxlog/pg_resetxlog.c +++ b/src/bin/pg_resetxlog/pg_resetxlog.c @@ -23,7 +23,7 @@ * Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/bin/pg_resetxlog/pg_resetxlog.c,v 1.66 2008/09/23 09:20:38 heikki Exp $ + * $PostgreSQL: pgsql/src/bin/pg_resetxlog/pg_resetxlog.c,v 1.67 2008/09/24 08:59:42 mha Exp $ * *------------------------------------------------------------------------- */ @@ -373,7 +373,7 @@ ReadControlFile(void) char *buffer; pg_crc32 crc; - if ((fd = open(XLOG_CONTROL_FILE, O_RDONLY, 0)) < 0) + if ((fd = open(XLOG_CONTROL_FILE, O_RDONLY | PG_BINARY, 0)) < 0) { /* * If pg_control is not there at all, or we can't read it, the odds |