From c4e5ec592fb04def28fbcb63da6573520047d89c Mon Sep 17 00:00:00 2001 From: Magnus Hagander Date: Wed, 24 Sep 2008 08:59:44 +0000 Subject: 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 --- src/bin/pg_resetxlog/pg_resetxlog.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/bin/pg_resetxlog/pg_resetxlog.c') diff --git a/src/bin/pg_resetxlog/pg_resetxlog.c b/src/bin/pg_resetxlog/pg_resetxlog.c index 15613832792..d90258a5331 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-2006, 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.53 2006/10/04 00:30:05 momjian Exp $ + * $PostgreSQL: pgsql/src/bin/pg_resetxlog/pg_resetxlog.c,v 1.53.2.1 2008/09/24 08:59:44 mha Exp $ * *------------------------------------------------------------------------- */ @@ -366,7 +366,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 -- cgit v1.2.3