mirror of
https://github.com/git/git
synced 2024-11-05 18:59:29 +00:00
6346f704a0
Support an arbitrary file descriptor expression in the semantic patch for replacing open+die_errno with xopen, not just an identifier, and apply it. This makes the error message at the single affected place more consistent and reduces code duplication. Signed-off-by: René Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
19 lines
295 B
Text
19 lines
295 B
Text
@@
|
|
identifier fd;
|
|
identifier die_fn =~ "^(die|die_errno)$";
|
|
@@
|
|
int fd =
|
|
- open
|
|
+ xopen
|
|
(...);
|
|
- if ( \( fd < 0 \| fd == -1 \) ) { die_fn(...); }
|
|
|
|
@@
|
|
expression fd;
|
|
identifier die_fn =~ "^(die|die_errno)$";
|
|
@@
|
|
fd =
|
|
- open
|
|
+ xopen
|
|
(...);
|
|
- if ( \( fd < 0 \| fd == -1 \) ) { die_fn(...); }
|