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:
Junio C Hamano
2021-10-12 13:51:28 -07:00
16 changed files with 36 additions and 53 deletions

View 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(...); }