Skip to content

Commit 1a83950

Browse files
uudiinjarkkojs
authored andcommitted
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. Signed-off-by: Tianjia Zhang <[email protected]> Reviewed-by: Jarkko Sakkinen <[email protected]> Signed-off-by: Jarkko Sakkinen <[email protected]>
1 parent 74ad433 commit 1a83950

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

scripts/sign-file.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ static void drain_openssl_errors(void)
114114
bool __cond = (cond); \
115115
display_openssl_errors(__LINE__); \
116116
if (__cond) { \
117-
err(1, fmt, ## __VA_ARGS__); \
117+
errx(1, fmt, ## __VA_ARGS__); \
118118
} \
119119
} while(0)
120120

0 commit comments

Comments
 (0)