diff options
author | Andi Kleen <ak@linux.intel.com> | 2009-11-25 17:51:56 +0100 |
---|---|---|
committer | Andi Kleen <ak@linux.intel.com> | 2009-11-25 17:51:56 +0100 |
commit | 94b1f943cf8b4ec8254ce49fe081181867eb1bb8 (patch) | |
tree | c604f7e3558f8cb63f8b2477cb657fc6e115b444 | |
parent | a014d78a2716d3cbc1903d074a4ff78b483309a1 (diff) | |
download | mce-inject-94b1f943cf8b4ec8254ce49fe081181867eb1bb8.tar.gz |
Fix error messages to print line number
And don't use err() when no errno
Signed-off-by: Andi Kleen <ak@linux.intel.com>
-rw-r--r-- | mce-inject.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/mce-inject.c b/mce-inject.c index 57b39ec..9bfd2ef 100644 --- a/mce-inject.c +++ b/mce-inject.c @@ -89,7 +89,7 @@ void init_cpu_info(void) fclose(f); if (!cpu_num) - err("getting cpu ids from /proc/cpuinfo"); + fprintf(stderr, "cannot get cpu ids from /proc/cpuinfo\n"); } void init_inject(void) @@ -110,7 +110,7 @@ static inline int cpu_id_to_index(int id) for (i = 0; i < cpu_num; i++) if (cpu_map[i] == id) return i; - err("invalid cpu id"); + yyerror("cpu %d not online\n", id); return -1; } @@ -118,7 +118,7 @@ static void validate_mce(struct mce *m) { cpu_id_to_index(m->extcpu); if (m->bank > max_bank()) { - fprintf(stderr, "larger machine check bank %d than supported on this cpu (%d)\n", + yyerror("larger machine check bank %d than supported on this cpu (%d)\n", (int)m->bank, max_bank()); exit(1); } |