Skip to contentSkip to conversation

sign-file: stop referring to the code as main.c

PATCH In review James Bottomley 2 participants 2 messages Oct 22, 2018

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

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.

---
 scripts/sign-file.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
scripts/sign-file.c +4 -4
index fbd34b8e8f57..563419bc2837 100644
@@ -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