sign-file: stop referring to the code as main.c
Subsystems (2)
PATCH v2 1/4 sign-file: stop referring to the code as main.c
All errors in sign-file print out a line number in main.c. Fix this by using the proper __FILE__ designation.
Signed-off-by James Bottomley <[email protected]>
--- scripts/sign-file.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
scripts/sign-file.c +4 -4
@@ -76,7 +76,7 @@ void format(void)exit (2 ); } -static void display_openssl_errors (int l) +static void display_openssl_errors (const char *f,int l) {const char *file;char buf[120 ];
@@ -84,7 +84,7 @@ static void display_openssl_errors(int l)if (ERR_peek_error () =0 )return ; -fprintf (stderr,"At main.c:%d:\n" , l); +fprintf (stderr,"At %s:%d:\n" , f, l);while ((e =ERR_get_error_line (&file, &line))) {ERR_error_string (e, buf);
@@ -105,7 +105,7 @@ static void drain_openssl_errors(void)#define ERR (cond, fmt, ...) \ do { \ bool __cond = (cond); \ - display_openssl_errors(__LINE__); \ + display_openssl_errors(__FILE__, __LINE__);\ if (__cond) { \ err(1, fmt, ## __VA_ARGS__); \ } \
@@ -299,7 +299,7 @@ int main(int argc, char **argv)/* Digest the module data. */ OpenSSL_add_all_digests (); -display_openssl_errors (__LINE__); +display_openssl_errors (__FILE__, __LINE__); digest_algo =EVP_get_digestbyname (hash_algo);ERR (!digest_algo,"EVP_get_digestbyname" );
Signature · 1 line
2.16.4
Quoted 5 lines · James Bottomley
All errors in sign-file print out a line number in
main.c. Fix this by using the proper__FILE__designation.Signed-off-by James Bottomley <[email protected]Quoted 1 line
Acked-by David Woodhouse <[email protected]>