Commit a73d083
committed
Modernize our code for looking up descriptive strings for Unix signals.
At least as far back as the 2008 spec, POSIX has defined strsignal(3)
for looking up descriptive strings for signal numbers. We hadn't gotten
the word though, and were still using the crufty old sys_siglist array,
which is in no standard even though most Unixen provide it.
Aside from not being formally standards-compliant, this was just plain
ugly because it involved #ifdef's at every place using the code.
To eliminate the #ifdef's, create a portability function pg_strsignal,
which wraps strsignal(3) if available and otherwise falls back to
sys_siglist[] if available. The set of Unixen with neither API is
probably empty these days, but on any platform with neither, you'll
just get "unrecognized signal". All extant callers print the numeric
signal number too, so no need to work harder than that.
Along the way, upgrade pg_basebackup's child-error-exit reporting
to match the rest of the system.
Discussion: https://postgr.es/m/25758.1544983503@sss.pgh.pa.us1 parent 16fda4b commit a73d083
File tree
12 files changed
+97
-54
lines changed- src
- backend/postmaster
- bin/pg_basebackup
- common
- include
- port
- test/regress
12 files changed
+97
-54
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15230 | 15230 | | |
15231 | 15231 | | |
15232 | 15232 | | |
15233 | | - | |
| 15233 | + | |
15234 | 15234 | | |
15235 | 15235 | | |
15236 | 15236 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1621 | 1621 | | |
1622 | 1622 | | |
1623 | 1623 | | |
| 1624 | + | |
1624 | 1625 | | |
1625 | 1626 | | |
1626 | 1627 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
650 | 650 | | |
651 | 651 | | |
652 | 652 | | |
653 | | - | |
654 | | - | |
655 | | - | |
656 | | - | |
657 | | - | |
658 | | - | |
659 | | - | |
660 | 653 | | |
661 | 654 | | |
662 | | - | |
663 | | - | |
| 655 | + | |
| 656 | + | |
664 | 657 | | |
665 | 658 | | |
666 | 659 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3612 | 3612 | | |
3613 | 3613 | | |
3614 | 3614 | | |
| 3615 | + | |
3615 | 3616 | | |
3616 | 3617 | | |
3617 | 3618 | | |
| |||
3622 | 3623 | | |
3623 | 3624 | | |
3624 | 3625 | | |
3625 | | - | |
| 3626 | + | |
3626 | 3627 | | |
3627 | 3628 | | |
3628 | 3629 | | |
3629 | 3630 | | |
3630 | 3631 | | |
3631 | 3632 | | |
3632 | 3633 | | |
3633 | | - | |
3634 | | - | |
3635 | | - | |
3636 | | - | |
3637 | | - | |
3638 | | - | |
3639 | | - | |
3640 | | - | |
3641 | | - | |
3642 | | - | |
3643 | | - | |
| 3634 | + | |
3644 | 3635 | | |
3645 | 3636 | | |
| 3637 | + | |
3646 | 3638 | | |
3647 | 3639 | | |
3648 | 3640 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2066 | 2066 | | |
2067 | 2067 | | |
2068 | 2068 | | |
2069 | | - | |
| 2069 | + | |
2070 | 2070 | | |
2071 | 2071 | | |
2072 | 2072 | | |
| |||
2094 | 2094 | | |
2095 | 2095 | | |
2096 | 2096 | | |
2097 | | - | |
| 2097 | + | |
2098 | 2098 | | |
2099 | 2099 | | |
2100 | 2100 | | |
| |||
2103 | 2103 | | |
2104 | 2104 | | |
2105 | 2105 | | |
2106 | | - | |
| 2106 | + | |
2107 | 2107 | | |
2108 | 2108 | | |
2109 | | - | |
2110 | | - | |
2111 | | - | |
2112 | | - | |
2113 | | - | |
2114 | | - | |
2115 | | - | |
| 2109 | + | |
2116 | 2110 | | |
2117 | | - | |
2118 | | - | |
| 2111 | + | |
| 2112 | + | |
2119 | 2113 | | |
2120 | 2114 | | |
2121 | 2115 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
| 59 | + | |
59 | 60 | | |
60 | 61 | | |
61 | 62 | | |
62 | 63 | | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | 64 | | |
74 | 65 | | |
75 | | - | |
76 | | - | |
| 66 | + | |
| 67 | + | |
77 | 68 | | |
| 69 | + | |
78 | 70 | | |
79 | 71 | | |
80 | 72 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
559 | 559 | | |
560 | 560 | | |
561 | 561 | | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
562 | 565 | | |
563 | 566 | | |
564 | 567 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
415 | 415 | | |
416 | 416 | | |
417 | 417 | | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
418 | 421 | | |
419 | 422 | | |
420 | 423 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
209 | 209 | | |
210 | 210 | | |
211 | 211 | | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
212 | 215 | | |
213 | 216 | | |
214 | 217 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | | - | |
| 40 | + | |
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| |||
0 commit comments