1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2024-12-24 21:34:08 +03:00
systemd-stable/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);