summaryrefslogtreecommitdiff
path: root/contrib/coccinelle/xopen.cocci
blob: b71db670194c8025d5cb4c9c52a2c1faa90e342e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
@@
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(...); }