]> git.ipfire.org Git - thirdparty/systemd.git/blob - coccinelle/safe_fclose.cocci
fs-util: no need for fchmod_and_chown() to access /proc/self/fd directly
[thirdparty/systemd.git] / coccinelle / safe_fclose.cocci
1 @@
2 expression p;
3 @@
4 - if (p) {
5 - fclose(p);
6 - p = NULL;
7 - }
8 + p = safe_fclose(p);
9 @@
10 expression p;
11 @@
12 - if (p)
13 - fclose(p);
14 - p = NULL;
15 + p = safe_fclose(p);
16 @@
17 expression p;
18 @@
19 - fclose(p);
20 - p = NULL;
21 + p = safe_fclose(p);
22 @@
23 expression p;
24 @@
25 - if (p)
26 - fclose(p);
27 + safe_fclose(p);