From f684c74fca5eeb55172eaac046c1558034b53a7e Mon Sep 17 00:00:00 2001 From: Pavel Tikhomirov Date: Wed, 25 Jan 2023 10:57:18 +0300 Subject: [PATCH] lint: prohibit to use %m specifier in pr_* functions As our pr_* functions are complex and can call different system calls inside before actual printing (e.g. gettimeofday for timestamps) actual errno at the time of printing may be changed. Signed-off-by: Pavel Tikhomirov --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 83ae7ca5a..00bbf2811 100644 --- a/Makefile +++ b/Makefile @@ -441,7 +441,7 @@ lint: # Do not append \n to pr_perror or fail ! git --no-pager grep -E '^\s*\<(pr_perror|fail)\>.*\\n"' # Do not use %m with pr_perror or fail - ! git --no-pager grep -E '^\s*\<(pr_perror|fail)\>.*%m' + ! git --no-pager grep -E '^\s*\<(pr_(err|perror|warn|debug|info|msg)|fail)\>.*%m' # Do not use errno with pr_perror or fail ! git --no-pager grep -E '^\s*\<(pr_perror|fail)\>\(".*".*errno' # End pr_(err|warn|msg|info|debug) with \n