]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
coccinelle: check for invalid errno comparisons
authorFrantisek Sumsal <frantisek@sumsal.cz>
Wed, 7 Oct 2020 13:26:16 +0000 (15:26 +0200)
committerFrantisek Sumsal <frantisek@sumsal.cz>
Fri, 9 Oct 2020 12:48:44 +0000 (14:48 +0200)
Prompted by #15868

coccinelle/errno-check.cocci [new file with mode: 0644]

diff --git a/coccinelle/errno-check.cocci b/coccinelle/errno-check.cocci
new file mode 100644 (file)
index 0000000..709cb4a
--- /dev/null
@@ -0,0 +1,10 @@
+@@
+constant c;
+@@
+(
+- errno == -c
++ errno == c
+|
+- errno != -c
++ errno != c
+)