Commit d4a43b2
committed
Convert libpgport's pqsignal() to a void function.
The protections added by commit 3b00fdb introduced race
conditions to this function that can lead to bogus return values.
Since nobody seems to inspect the return value, this is of little
consequence, but it would have been nice to convert it to a void
function to avoid any possibility of a bogus return value. I
originally thought that doing so would have required also modifying
legacy-pqsignal.c's version of the function (which would've
required an SONAME bump), but commit 9a45a89 gave
legacy-pqsignal.c its own dedicated extern for pqsignal(), thereby
decoupling it enough that libpgport's pqsignal() can be modified.
This commit also adds an assertion for the return value of
sigaction()/signal(). Since a failure most likely indicates a
coding error, and nobody has ever bothered to check pqsignal()'s
return value, it's probably not worth the effort to do anything
fancier.
Reviewed-by: Tom Lane
Discussion: https://postgr.es/m/Z4chOKfnthRH71mw%40nathan1 parent 5cda4fd commit d4a43b2
2 files changed
+7
-29
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
520 | 520 | | |
521 | 521 | | |
522 | 522 | | |
523 | | - | |
| 523 | + | |
524 | 524 | | |
525 | 525 | | |
526 | 526 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
112 | 112 | | |
113 | 113 | | |
114 | 114 | | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | 115 | | |
128 | 116 | | |
129 | 117 | | |
130 | 118 | | |
131 | | - | |
| 119 | + | |
132 | 120 | | |
133 | 121 | | |
134 | | - | |
135 | 122 | | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
| 123 | + | |
140 | 124 | | |
141 | 125 | | |
142 | 126 | | |
| |||
155 | 139 | | |
156 | 140 | | |
157 | 141 | | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
| 142 | + | |
| 143 | + | |
164 | 144 | | |
165 | 145 | | |
166 | | - | |
167 | | - | |
168 | | - | |
169 | | - | |
| 146 | + | |
| 147 | + | |
170 | 148 | | |
171 | 149 | | |
0 commit comments