projects
/
users
/
bernd
/
postgres.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
bb6d67f
)
Don't try to close negative file descriptors, since this can cause
author
Magnus Hagander
<
[email protected]
>
Tue, 13 May 2008 20:54:02 +0000
(20:54 +0000)
committer
Magnus Hagander
<
[email protected]
>
Tue, 13 May 2008 20:54:02 +0000
(20:54 +0000)
crashes on certain platforms. In particular, the MSVC runtime is known
to do this.
Fixes bug #4162, reported and diagnosed by Javier Pimas
src/backend/access/transam/xlog.c
patch
|
blob
|
blame
|
history
diff --git
a/src/backend/access/transam/xlog.c
b/src/backend/access/transam/xlog.c
index 67541fce24fced9b48898cffa91f48530b3972ab..e43cf467fa442d6354f65198c5c8e6daab31172c 100644
(file)
--- a/
src/backend/access/transam/xlog.c
+++ b/
src/backend/access/transam/xlog.c
@@
-3317,8
+3317,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;
}