1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-04 22:21:55 +03:00
systemd/coccinelle/safe_close-no-if.cocci
Lennart Poettering 7f6e12b033 tree-wide: drop redundant if checks before safe_close()
Replace this:

        if (fd >= 0)
                safe_close(fd);

by this:

        safe_close(fd);
2015-09-09 08:20:19 +02:00

8 lines
88 B
Plaintext

@@
expression fd;
@@
- if (fd >= 0) {
- fd = safe_close(fd);
- }
+ fd = safe_close(fd);