projects
/
users
/
andresfreund
/
postgres.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
aa53382
)
Make FileGetRawDesc() ensure there's an associated kernel FD.
author
Andres Freund
<andres@anarazel.de>
Mon, 21 May 2018 22:43:30 +0000
(15:43 -0700)
committer
Andres Freund
<andres@anarazel.de>
Mon, 21 May 2018 22:43:30 +0000
(15:43 -0700)
Author: Andres Freund
Reviewed-By:
Discussion: https://postgr.es/m/
Backpatch:
src/backend/storage/file/fd.c
patch
|
blob
|
blame
|
history
diff --git
a/src/backend/storage/file/fd.c
b/src/backend/storage/file/fd.c
index 65e46483a44bce571c01b609f76a71e610b65294..8ae13a51ec1ae32e59f2d19d55f25f73727e8563 100644
(file)
--- a/
src/backend/storage/file/fd.c
+++ b/
src/backend/storage/file/fd.c
@@
-2232,6
+2232,10
@@
int
FileGetRawDesc(File file)
{
Assert(FileIsValid(file));
+
+ if (FileAccess(file))
+ return -1;
+
return VfdCache[file].fd;
}