aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/adt/ruleutils.c
diff options
context:
space:
mode:
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>2012-10-18 22:26:26 +0300
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>2012-10-18 22:30:42 +0300
commitd2a5f326568dfe98559319db6f3b9d08f0c851cc (patch)
tree4f1c6519a687c0a574f76a2054cbea3322a72712 /src/backend/utils/adt/ruleutils.c
parent447dad7193721f757dddf7c409b0b75aa2b5fb98 (diff)
downloadpostgresql-d2a5f326568dfe98559319db6f3b9d08f0c851cc.tar.gz
postgresql-d2a5f326568dfe98559319db6f3b9d08f0c851cc.zip
Further tweaking of the readfile() function in pg_ctl.
Don't leak a file descriptor if the file is empty or we can't read its size. Expect there to be a newline at the end of the last line, too. If there isn't, ignore anything after the last newline. This makes it a tiny bit more robust in case the file is appended to concurrently, so that we don't return the last line if it hasn't been fully written yet. And this makes the code a bit less obscure, anyway. Per Tom Lane's suggestion. Backpatch to all supported branches.
Diffstat (limited to 'src/backend/utils/adt/ruleutils.c')
0 files changed, 0 insertions, 0 deletions