forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitd56cb42
committed
Activate perlcritic InputOutput::RequireCheckedSyscalls and fix resulting warnings
This checks that certain I/O-related Perl functions properly checktheir return value. Some parts of the PostgreSQL code had been a bitsloppy about that. The new perlcritic warnings are fixed here. Ididn't design any beautiful error messages, mostly just used "or die$!", which mostly matches existing code, and also this isdeveloper-level code, so having the system error plus source codereference should be ok.Initially, we only activate this check for a subset of what theperlcritic check would warn about. The effective list is chmod flock open read rename seek symlink systemThe initial set of functions is picked because most existing codealready checked the return value of those, so any omissions areprobably unintended, or because it seems important for testcorrectness.The actual perlcritic configuration is written as an exclude list.That seems better so that we are clear on what we are currently notchecking. Maybe future patches want to investigate checking some ofthe other functions. (In principle, we might eventually want to checkall of them, but since this is test and build support code, notproduction code, there are probably some reasonable compromises to bemade.)Reviewed-by: Daniel Gustafsson <daniel@yesql.se>Discussion:https://www.postgresql.org/message-id/flat/88b7d4f2-46d9-4cc7-b1f7-613c90f9a76a%40eisentraut.org1 parentbb5604b commitd56cb42
File tree
15 files changed
+52
-43
lines changed- src
- bin
- pg_archivecleanup/t
- pg_basebackup/t
- pg_ctl/t
- pg_resetwal/t
- pg_rewind/t
- pl/plperl
- test
- kerberos/t
- modules/ssl_passphrase_callback/t
- perl/PostgreSQL/Test
- ssl/t/SSL
- tools
- perlcheck
- pgindent
15 files changed
+52
-43
lines changedLines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
36 | 36 |
| |
37 | 37 |
| |
38 | 38 |
| |
39 |
| - | |
| 39 | + | |
40 | 40 |
| |
41 | 41 |
| |
42 | 42 |
| |
|
Lines changed: 4 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
77 | 77 |
| |
78 | 78 |
| |
79 | 79 |
| |
80 |
| - | |
| 80 | + | |
81 | 81 |
| |
82 | 82 |
| |
83 | 83 |
| |
| |||
175 | 175 |
| |
176 | 176 |
| |
177 | 177 |
| |
178 |
| - | |
| 178 | + | |
179 | 179 |
| |
180 | 180 |
| |
181 | 181 |
| |
| |||
185 | 185 |
| |
186 | 186 |
| |
187 | 187 |
| |
188 |
| - | |
| 188 | + | |
189 | 189 |
| |
190 | 190 |
| |
191 | 191 |
| |
| |||
423 | 423 |
| |
424 | 424 |
| |
425 | 425 |
| |
426 |
| - | |
| 426 | + | |
427 | 427 |
| |
428 | 428 |
| |
429 | 429 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
23 | 23 |
| |
24 | 24 |
| |
25 | 25 |
| |
26 |
| - | |
| 26 | + | |
27 | 27 |
| |
28 | 28 |
| |
29 | 29 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
21 | 21 |
| |
22 | 22 |
| |
23 | 23 |
| |
24 |
| - | |
| 24 | + | |
25 | 25 |
| |
26 | 26 |
| |
27 | 27 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
69 | 69 |
| |
70 | 70 |
| |
71 | 71 |
| |
72 |
| - | |
| 72 | + | |
73 | 73 |
| |
74 | 74 |
| |
75 | 75 |
| |
|
Lines changed: 2 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
311 | 311 |
| |
312 | 312 |
| |
313 | 313 |
| |
314 |
| - | |
315 |
| - | |
| 314 | + | |
| 315 | + | |
316 | 316 |
| |
317 | 317 |
| |
318 | 318 |
| |
|
Lines changed: 2 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
88 | 88 |
| |
89 | 89 |
| |
90 | 90 |
| |
91 |
| - | |
| 91 | + | |
92 | 92 |
| |
93 | 93 |
| |
94 | 94 |
| |
95 |
| - | |
| 95 | + | |
96 | 96 |
| |
97 | 97 |
| |
98 | 98 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
111 | 111 |
| |
112 | 112 |
| |
113 | 113 |
| |
114 |
| - | |
| 114 | + | |
115 | 115 |
| |
116 | 116 |
| |
117 | 117 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
33 | 33 |
| |
34 | 34 |
| |
35 | 35 |
| |
36 |
| - | |
| 36 | + | |
37 | 37 |
| |
38 | 38 |
| |
39 | 39 |
| |
|
Lines changed: 6 additions & 6 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
467 | 467 |
| |
468 | 468 |
| |
469 | 469 |
| |
470 |
| - | |
| 470 | + | |
471 | 471 |
| |
472 | 472 |
| |
473 | 473 |
| |
| |||
580 | 580 |
| |
581 | 581 |
| |
582 | 582 |
| |
583 |
| - | |
| 583 | + | |
584 | 584 |
| |
585 | 585 |
| |
586 | 586 |
| |
| |||
862 | 862 |
| |
863 | 863 |
| |
864 | 864 |
| |
865 |
| - | |
| 865 | + | |
866 | 866 |
| |
867 | 867 |
| |
868 | 868 |
| |
| |||
1688 | 1688 |
| |
1689 | 1689 |
| |
1690 | 1690 |
| |
1691 |
| - | |
| 1691 | + | |
1692 | 1692 |
| |
1693 | 1693 |
| |
1694 | 1694 |
| |
1695 | 1695 |
| |
1696 | 1696 |
| |
1697 |
| - | |
| 1697 | + | |
1698 | 1698 |
| |
1699 | 1699 |
| |
1700 |
| - | |
| 1700 | + | |
1701 | 1701 |
| |
1702 | 1702 |
| |
1703 | 1703 |
| |
|
Lines changed: 8 additions & 8 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
211 | 211 |
| |
212 | 212 |
| |
213 | 213 |
| |
214 |
| - | |
215 |
| - | |
216 |
| - | |
217 |
| - | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
218 | 218 |
| |
219 | 219 |
| |
220 | 220 |
| |
| |||
564 | 564 |
| |
565 | 565 |
| |
566 | 566 |
| |
567 |
| - | |
| 567 | + | |
568 | 568 |
| |
569 | 569 |
| |
570 | 570 |
| |
571 | 571 |
| |
572 | 572 |
| |
573 | 573 |
| |
574 | 574 |
| |
575 |
| - | |
| 575 | + | |
576 | 576 |
| |
577 | 577 |
| |
578 | 578 |
| |
| |||
789 | 789 |
| |
790 | 790 |
| |
791 | 791 |
| |
792 |
| - | |
| 792 | + | |
793 | 793 |
| |
794 | 794 |
| |
795 | 795 |
| |
796 |
| - | |
| 796 | + | |
797 | 797 |
| |
798 | 798 |
| |
799 | 799 |
| |
|
Lines changed: 5 additions & 5 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
191 | 191 |
| |
192 | 192 |
| |
193 | 193 |
| |
194 |
| - | |
| 194 | + | |
195 | 195 |
| |
196 | 196 |
| |
197 | 197 |
| |
| |||
204 | 204 |
| |
205 | 205 |
| |
206 | 206 |
| |
207 |
| - | |
| 207 | + | |
208 | 208 |
| |
209 | 209 |
| |
210 | 210 |
| |
| |||
290 | 290 |
| |
291 | 291 |
| |
292 | 292 |
| |
293 |
| - | |
| 293 | + | |
294 | 294 |
| |
295 | 295 |
| |
296 | 296 |
| |
| |||
315 | 315 |
| |
316 | 316 |
| |
317 | 317 |
| |
318 |
| - | |
| 318 | + | |
319 | 319 |
| |
320 | 320 |
| |
321 | 321 |
| |
| |||
337 | 337 |
| |
338 | 338 |
| |
339 | 339 |
| |
340 |
| - | |
| 340 | + | |
341 | 341 |
| |
342 | 342 |
| |
343 | 343 |
| |
|
Lines changed: 2 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
195 | 195 |
| |
196 | 196 |
| |
197 | 197 |
| |
198 |
| - | |
199 |
| - | |
| 198 | + | |
| 199 | + | |
200 | 200 |
| |
201 | 201 |
| |
202 | 202 |
| |
|
Lines changed: 8 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
29 | 29 |
| |
30 | 30 |
| |
31 | 31 |
| |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + |
Lines changed: 9 additions & 8 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
80 | 80 |
| |
81 | 81 |
| |
82 | 82 |
| |
83 |
| - | |
84 |
| - | |
| 83 | + | |
85 | 84 |
| |
86 |
| - | |
87 |
| - | |
88 |
| - | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
89 | 91 |
| |
90 | 92 |
| |
91 | 93 |
| |
| |||
95 | 97 |
| |
96 | 98 |
| |
97 | 99 |
| |
98 |
| - | |
99 |
| - | |
| 100 | + | |
100 | 101 |
| |
101 | 102 |
| |
102 | 103 |
| |
| |||
283 | 284 |
| |
284 | 285 |
| |
285 | 286 |
| |
286 |
| - | |
| 287 | + | |
287 | 288 |
| |
288 | 289 |
| |
289 | 290 |
| |
|
0 commit comments
Comments
(0)