]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
coccinelle: ignore specific cases to use SYNTHETIC_ERRNO() macro 17732/head
authorYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 26 Nov 2020 23:47:26 +0000 (08:47 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 27 Nov 2020 05:35:20 +0000 (14:35 +0900)
coccinelle/synthetic-errno.cocci

index 3d9af0db21bb80f02828eb6419ea5b21529d394a..dcae069f748664fffaaa930562c7ebf00ee97c4a 100644 (file)
@@ -15,9 +15,15 @@ log_debug("Found no default boot entry :(");
 expression e;
 expression list args;
 @@
+(
+/* Ignore specific cases in src/import/{export,import,pull}.c where we want to return positive value on success. */
+log_info("Exiting.");
+return -r;
+|
 - log_info(args);
 - return -e;
 + return log_info_errno(SYNTHETIC_ERRNO(e), args);
+)
 @@
 expression e;
 expression list args;