forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitd2a5f32
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 parent447dad7 commitd2a5f32
1 file changed
+11
-4
lines changedLines changed: 11 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
328 | 328 |
| |
329 | 329 |
| |
330 | 330 |
| |
| 331 | + | |
| 332 | + | |
331 | 333 |
| |
| 334 | + | |
332 | 335 |
| |
333 | 336 |
| |
334 | 337 |
| |
| 338 | + | |
335 | 339 |
| |
336 | 340 |
| |
337 | 341 |
| |
| |||
347 | 351 |
| |
348 | 352 |
| |
349 | 353 |
| |
350 |
| - | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
351 | 359 |
| |
352 |
| - | |
| 360 | + | |
353 | 361 |
| |
354 | 362 |
| |
355 | 363 |
| |
356 | 364 |
| |
357 |
| - | |
358 | 365 |
| |
359 | 366 |
| |
360 | 367 |
| |
| |||
364 | 371 |
| |
365 | 372 |
| |
366 | 373 |
| |
367 |
| - | |
| 374 | + | |
368 | 375 |
| |
369 | 376 |
| |
370 | 377 |
| |
|
0 commit comments
Comments
(0)