git.postgresql.org Git - postgresql.git/commit

git projects / postgresql.git / commit
? search:
summary | shortlog | log | commit | commitdiff | tree
(parent: aba24b5) | patch
Remove setvbuf() call from PQtrace()
2021年3月31日 23:11:51 +0000 (20:11 -0300)
2021年3月31日 23:11:51 +0000 (20:11 -0300)
commit 6ec578e60101c3c02533f99715945a0400fb3286
Remove setvbuf() call from PQtrace()

It's misplaced there -- it's not libpq's output stream to tweak in that
way. In particular, POSIX says that it has to be called before any
other operation on the file, so if a stream previously used by the
calling application, bad things may happen.

Put setvbuf() in libpq_pipeline for good measure.

Also, reduce fopen(..., "w+") to just fopen(..., "w") in
libpq_pipeline.c. It's not clear that this fixes anything, but we don't
use w+ anywhere.

Per complaints from Tom Lane.

Discussion: https://postgr.es/m/3337422.1617229905@sss.pgh.pa.us
src/interfaces/libpq/fe-trace.c diff | blob | blame | history
src/test/modules/libpq_pipeline/libpq_pipeline.c diff | blob | blame | history
This is the main PostgreSQL git repository.
RSS Atom

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