forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitc95ede4
committed
In count_usable_fds(), duplicate stderr not stdin.
We had a complaint that the postmaster fails to start if the invokingprogram closes stdin. That happens because count_usable_fds expectsto be able to dup(0), and if it can't, we conclude there are no freeFDs and go belly-up. So far as I can find, though, there is no otherplace in the server that touches stdin, and it's not unreasonable toexpect that a daemon wouldn't use that file.As a simple improvement, let's dup FD 2 (stderr) instead. Unlike stdin,it *is* reasonable for us to expect that stderr be open; even if we areconfigured not to touch it, common libraries such as libc might try towrite error messages there.Per gripe from Mario Emmenlauer. Given the lack of previous complaints,I'm not excited about pushing this into stable branches, but it seemsOK to squeeze it into v14.Discussion:https://postgr.es/m/48bafc63-c30f-3962-2ded-f2e985d93e86@emmenlauer.de1 parentce773f2 commitc95ede4
1 file changed
+5
-3
lines changedLines changed: 5 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
934 | 934 |
| |
935 | 935 |
| |
936 | 936 |
| |
937 |
| - | |
| 937 | + | |
| 938 | + | |
| 939 | + | |
938 | 940 |
| |
939 | 941 |
| |
940 | 942 |
| |
| |||
978 | 980 |
| |
979 | 981 |
| |
980 | 982 |
| |
981 |
| - | |
| 983 | + | |
982 | 984 |
| |
983 | 985 |
| |
984 | 986 |
| |
985 | 987 |
| |
986 |
| - | |
| 988 | + | |
987 | 989 |
| |
988 | 990 |
| |
989 | 991 |
| |
|
0 commit comments
Comments
(0)