Commit 89e434b
committed
Fix coding rules violations in walreceiver.c
1. Since commit b1a9bad we had pstrdup() inside a
spinlock-protected critical section; reported by Andreas Seltenreich.
Turn those into strlcpy() to stack-allocated variables instead.
Backpatch to 9.6.
2. Since commit 9ed551e we had a pfree() uselessly inside a
spinlock-protected critical section. Tom Lane noticed in code review.
Move down. Backpatch to 9.6.
3. Since commit 6423390 we had GetCurrentTimestamp() (a kernel
call) inside a spinlock-protected critical section. Tom Lane noticed in
code review. Move it up. Backpatch to 9.2.
4. Since commit 1bb2558 we did elog(PANIC) while holding spinlock.
Tom Lane noticed in code review. Release spinlock before dying.
Backpatch to 9.2.
Discussion: https://postgr.es/m/87h8vhtgj2.fsf@ansel.ydns.eu1 parent f41bd4c commit 89e434b
1 file changed
+13
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
196 | 196 | | |
197 | 197 | | |
198 | 198 | | |
| 199 | + | |
199 | 200 | | |
200 | 201 | | |
201 | 202 | | |
| |||
205 | 206 | | |
206 | 207 | | |
207 | 208 | | |
| 209 | + | |
| 210 | + | |
208 | 211 | | |
209 | 212 | | |
210 | 213 | | |
| |||
235 | 238 | | |
236 | 239 | | |
237 | 240 | | |
| 241 | + | |
238 | 242 | | |
239 | 243 | | |
240 | 244 | | |
| |||
249 | 253 | | |
250 | 254 | | |
251 | 255 | | |
252 | | - | |
| 256 | + | |
| 257 | + | |
253 | 258 | | |
254 | 259 | | |
255 | 260 | | |
| |||
308 | 313 | | |
309 | 314 | | |
310 | 315 | | |
311 | | - | |
312 | 316 | | |
313 | | - | |
314 | | - | |
315 | 317 | | |
316 | 318 | | |
317 | 319 | | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
318 | 323 | | |
319 | 324 | | |
320 | 325 | | |
| |||
1390 | 1395 | | |
1391 | 1396 | | |
1392 | 1397 | | |
1393 | | - | |
1394 | | - | |
| 1398 | + | |
| 1399 | + | |
1395 | 1400 | | |
1396 | 1401 | | |
1397 | 1402 | | |
| |||
1406 | 1411 | | |
1407 | 1412 | | |
1408 | 1413 | | |
1409 | | - | |
1410 | | - | |
| 1414 | + | |
| 1415 | + | |
1411 | 1416 | | |
1412 | 1417 | | |
1413 | 1418 | | |
| |||
0 commit comments