]> git.ipfire.org Git - thirdparty/systemd.git/blame - 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
CommitLineData
74ca738f
LP
1@@
2expression p;
3@@
4- if (p) {
5- fclose(p);
6- p = NULL;
7- }
8+ p = safe_fclose(p);
9@@
10expression p;
11@@
12- if (p)
13- fclose(p);
14- p = NULL;
15+ p = safe_fclose(p);
16@@
17expression p;
18@@
19- fclose(p);
20- p = NULL;
21+ p = safe_fclose(p);
22@@
23expression p;
24@@
25- if (p)
26- fclose(p);
27+ safe_fclose(p);