]> git.ipfire.org Git - thirdparty/systemd.git/blame - coccinelle/synthetic-errno.cocci
test: Disable LUKS devices from initramfs in QEMU tests
[thirdparty/systemd.git] / coccinelle / synthetic-errno.cocci
CommitLineData
baaa35ad
ZJS
1@@
2expression e;
3expression list args;
4@@
ccd52940
FS
5(
6/* Ignore one specific case in src/shared/bootspec.c where we want to stick
7 * with the log_debug() + return pattern */
8log_debug("Found no default boot entry :(");
9|
baaa35ad
ZJS
10- log_debug(args);
11- return -e;
12+ return log_debug_errno(SYNTHETIC_ERRNO(e), args);
ccd52940 13)
baaa35ad
ZJS
14@@
15expression e;
16expression list args;
17@@
18- log_info(args);
19- return -e;
20+ return log_info_errno(SYNTHETIC_ERRNO(e), args);
21@@
22expression e;
23expression list args;
24@@
25- log_notice(args);
26- return -e;
27+ return log_notice_errno(SYNTHETIC_ERRNO(e), args);
28@@
29expression e;
30expression list args;
31@@
32- log_error(args);
33- return -e;
34+ return log_error_errno(SYNTHETIC_ERRNO(e), args);
35@@
36expression e;
37expression list args;
38@@
39- log_emergency(args);
40- return -e;
41+ return log_emergency_errno(SYNTHETIC_ERRNO(e), args);
886cf317
ZJS
42@@
43identifier log_LEVEL_errno =~ "^log_(debug|info|notice|warning|error|emergency)_errno$";
44identifier ERRNO =~ "^E[A-Z]+$";
45expression list args;
46@@
47- return log_LEVEL_errno(ERRNO, args);
48+ return log_LEVEL_errno(SYNTHETIC_ERRNO(ERRNO), args);