sign-file: Fix confusing error messages
Subsystems (2)
PATCH RESEND v2 1/1 sign-file: Fix confusing error messages
When an error occurs, use errx() instead of err() to display the error message, because openssl has its own error record. When an error occurs, errno will not be changed, while err() displays the errno error message. It will cause confusion. For example, when CMS_add1_signer() fails, the following message will appear:
sign-file: CMS_add1_signer: Success
errx() ignores errno and does not cause such issue.
--- scripts/sign-file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/sign-file.c +1 -1
@@ -114,7 +114,7 @@ static void drain_openssl_errors(void)bool __cond = (cond); \display_openssl_errors (__LINE__); \if (__cond) { \ - err(1, fmt, ## __VA_ARGS__); \ + errx(1, fmt, ## __VA_ARGS__); \ } \ }while (0 )
Signature · 1 line
2.24.3 (Apple Git-128)
Quoted 31 lines · Tianjia Zhang
When an error occurs, use
errx()instead oferr()to display the error message, because openssl has its own error record. When an error occurs, errno will not be changed, whileerr()displays the errno error message. It will cause confusion. For example, whenCMS_add1_signer()fails, the following message will appear:sign-file:
CMS_add1_signer: Success
errx()ignores errno and does not cause such issue.Signed-off-by Tianjia Zhang <[email protected]>--- scripts/sign-file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)scripts/sign-file.c +1
-1@@ -114,7 +114,7 @@ static void drain_openssl_errors(void)bool __cond = (cond); \display_openssl_errors (__LINE__); \if (__cond) { \ - err(1, fmt, ## __VA_ARGS__); \ + errx(1, fmt, ## __VA_ARGS__); \ } \ }while (0 )Signature · 1 line
2.24.3 (Apple Git-128)
BR, Jarkko