- Notifications
You must be signed in to change notification settings - Fork5
Commit2a49585
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 parent160984c commit2a49585
1 file changed
+11
-4
lines changedLines changed: 11 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
338 | 338 |
| |
339 | 339 |
| |
340 | 340 |
| |
| 341 | + | |
| 342 | + | |
341 | 343 |
| |
| 344 | + | |
342 | 345 |
| |
343 | 346 |
| |
344 | 347 |
| |
| 348 | + | |
345 | 349 |
| |
346 | 350 |
| |
347 | 351 |
| |
| |||
357 | 361 |
| |
358 | 362 |
| |
359 | 363 |
| |
360 |
| - | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
361 | 369 |
| |
362 |
| - | |
| 370 | + | |
363 | 371 |
| |
364 | 372 |
| |
365 | 373 |
| |
366 | 374 |
| |
367 |
| - | |
368 | 375 |
| |
369 | 376 |
| |
370 | 377 |
| |
| |||
374 | 381 |
| |
375 | 382 |
| |
376 | 383 |
| |
377 |
| - | |
| 384 | + | |
378 | 385 |
| |
379 | 386 |
| |
380 | 387 |
| |
|
0 commit comments
Comments
(0)