forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commite7bab08
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 parent623e49c commite7bab08
1 file changed
+11
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
333 | 333 | | |
334 | 334 | | |
335 | 335 | | |
| 336 | + | |
| 337 | + | |
336 | 338 | | |
| 339 | + | |
337 | 340 | | |
338 | 341 | | |
339 | 342 | | |
| 343 | + | |
340 | 344 | | |
341 | 345 | | |
342 | 346 | | |
| |||
352 | 356 | | |
353 | 357 | | |
354 | 358 | | |
355 | | - | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
356 | 364 | | |
357 | | - | |
| 365 | + | |
358 | 366 | | |
359 | 367 | | |
360 | 368 | | |
361 | 369 | | |
362 | | - | |
363 | 370 | | |
364 | 371 | | |
365 | 372 | | |
| |||
369 | 376 | | |
370 | 377 | | |
371 | 378 | | |
372 | | - | |
| 379 | + | |
373 | 380 | | |
374 | 381 | | |
375 | 382 | | |
| |||
0 commit comments
Comments
(0)