Merge branch 'rs/xopen-reports-open-failures' into maint
Error diagnostics improvement. * rs/xopen-reports-open-failures: use xopen() to handle fatal open(2) failures xopen: explicitly report creation failures
This commit is contained in:
16
contrib/coccinelle/xopen.cocci
Normal file
16
contrib/coccinelle/xopen.cocci
Normal file
@ -0,0 +1,16 @@
|
||||
@@
|
||||
identifier fd;
|
||||
identifier die_fn =~ "^(die|die_errno)$";
|
||||
@@
|
||||
(
|
||||
fd =
|
||||
- open
|
||||
+ xopen
|
||||
(...);
|
||||
|
|
||||
int fd =
|
||||
- open
|
||||
+ xopen
|
||||
(...);
|
||||
)
|
||||
- if ( \( fd < 0 \| fd == -1 \) ) { die_fn(...); }
|
Reference in New Issue
Block a user