git.postgresql.org Git - postgresql.git/commitdiff

git projects / postgresql.git / commitdiff
? search:
summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: d82a1d5)
Don't try to close negative file descriptors, since this can cause
2008年5月13日 20:53:52 +0000 (20:53 +0000)
2008年5月13日 20:53:52 +0000 (20:53 +0000)
crashes on certain platforms. In particular, the MSVC runtime is known
to do this.

Fixes bug #4162, reported and diagnosed by Javier Pimas


diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c
index 3504c7386699799885d6f606ddc7432aaffb8719..28e5076852362184153f1933afb04427440a1515 100644 (file)
--- a/src/backend/access/transam/xlog.c
+++ b/src/backend/access/transam/xlog.c
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/backend/access/transam/xlog.c,v 1.307 2008年05月12日 19:45:23 mha Exp $
+ * $PostgreSQL: pgsql/src/backend/access/transam/xlog.c,v 1.308 2008年05月13日 20:53:52 mha Exp $
*
*-------------------------------------------------------------------------
*/
@@ -3334,8 +3334,11 @@ got_record:;
return (XLogRecord *) buffer;
next_record_is_invalid:;
- close(readFile);
- readFile = -1;
+ if (readFile >= 0)
+ {
+ close(readFile);
+ readFile = -1;
+ }
nextRecord = NULL;
return NULL;
}
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /