Commit 6ec578e
committed
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.us1 parent aba24b5 commit 6ec578e
File tree
2 files changed
+5
-4
lines changed- src
- interfaces/libpq
- test/modules/libpq_pipeline
2 files changed
+5
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | | - | |
44 | | - | |
45 | 43 | | |
46 | 44 | | |
47 | 45 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1319 | 1319 | | |
1320 | 1320 | | |
1321 | 1321 | | |
1322 | | - | |
1323 | | - | |
| 1322 | + | |
1324 | 1323 | | |
1325 | 1324 | | |
| 1325 | + | |
| 1326 | + | |
| 1327 | + | |
| 1328 | + | |
1326 | 1329 | | |
1327 | 1330 | | |
1328 | 1331 | | |
| |||
0 commit comments