From f3368b52b60d7b46a39411a0e8f69e378a285f0a Mon Sep 17 00:00:00 2001
From: FlorealRISSO <floreal.risso@univ-tlse3.fr>
Date: Tue, 21 Mar 2023 12:52:02 +0100
Subject: [PATCH] error handling

---
 src/amd_rapl.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/amd_rapl.c b/src/amd_rapl.c
index adc4461..9eaac45 100644
--- a/src/amd_rapl.c
+++ b/src/amd_rapl.c
@@ -217,7 +217,7 @@ unsigned int get_nb_cpu()
 
 	if (n_cpu == 0) {
 		perror("open()");
-		fprintf(stderr, "on %s\n", filename);
+		fprintf(stderr, "on the file: '%s'\n", filename);
 		switch (cpy_errno) {
 			case ENOENT:
 				fprintf(stderr, "Amd rapl works with msr module, try to run 'sudo modprobe msr', then retry.\n");
@@ -226,7 +226,7 @@ unsigned int get_nb_cpu()
 				fprintf(stderr, "Amd rapl must be executed with the administrator privilege, try with 'sudo'.\n");
 				exit(98);
 			default:
-				fprintf(stderr, "Unexpected error");
+				fprintf(stderr, "Unexpected error\n");
 				exit(97);
 		}
 	}
-- 
GitLab