summaryrefslogtreecommitdiff
path: root/contrib/coccinelle/xopen.cocci
blob: 814d7b8a1a1c75af49a1e648d96901587709329c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
@@
identifier fd;
identifier die_fn =~ "^(die|die_errno)$";
@@
(
  fd =
- open
+ xopen
  (...);
|
  int fd =
- open
+ xopen
  (...);
)
- if ( \( fd < 0 \| fd == -1 \) ) { die_fn(...); }