forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit95ff5b3
committed
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 thereisn't, ignore anything after the last newline. This makes it a tiny bitmore robust in case the file is appended to concurrently, so that we don'treturn the last line if it hasn't been fully written yet. And this makesthe code a bit less obscure, anyway. Per Tom Lane's suggestion.Backpatch to all supported branches.1 parentafdc751 commit95ff5b3
1 file changed
+11
-4
lines changedLines changed: 11 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
320 | 320 |
| |
321 | 321 |
| |
322 | 322 |
| |
| 323 | + | |
| 324 | + | |
323 | 325 |
| |
| 326 | + | |
324 | 327 |
| |
325 | 328 |
| |
326 | 329 |
| |
| 330 | + | |
327 | 331 |
| |
328 | 332 |
| |
329 | 333 |
| |
| |||
339 | 343 |
| |
340 | 344 |
| |
341 | 345 |
| |
342 |
| - | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
343 | 351 |
| |
344 |
| - | |
| 352 | + | |
345 | 353 |
| |
346 | 354 |
| |
347 | 355 |
| |
348 | 356 |
| |
349 |
| - | |
350 | 357 |
| |
351 | 358 |
| |
352 | 359 |
| |
| |||
356 | 363 |
| |
357 | 364 |
| |
358 | 365 |
| |
359 |
| - | |
| 366 | + | |
360 | 367 |
| |
361 | 368 |
| |
362 | 369 |
| |
|
0 commit comments
Comments
(0)