1
0
mirror of https://github.com/postgres/postgres.git synced 2025-08-05 07:41:25 +03:00

Don't try to close negative file descriptors, since this can cause

crashes on certain platforms. In particular, the MSVC runtime is known
to do this.

Fixes bug #4162, reported and diagnosed by Javier Pimas
This commit is contained in:
Magnus Hagander
2008-05-13 20:54:00 +00:00
parent 5b12b1c377
commit 9b1e598edb

View File

@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group * Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* $PostgreSQL: pgsql/src/backend/access/transam/xlog.c,v 1.258.2.3 2008/04/17 00:00:00 tgl Exp $ * $PostgreSQL: pgsql/src/backend/access/transam/xlog.c,v 1.258.2.4 2008/05/13 20:54:00 mha Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@@ -3223,8 +3223,11 @@ got_record:;
return (XLogRecord *) buffer; return (XLogRecord *) buffer;
next_record_is_invalid:; next_record_is_invalid:;
close(readFile); if (readFile >= 0)
readFile = -1; {
close(readFile);
readFile = -1;
}
nextRecord = NULL; nextRecord = NULL;
return NULL; return NULL;
} }