commit 3ad587d20868f154bb7ab972ee7812add1380d7a Author: Greg Joyce Date: Wed Oct 11 12:10:40 2023 -0500 diag_nvme: improvements to status and err messages Signed-off-by: Greg Joyce diff --git a/diags/diag_nvme.c b/diags/diag_nvme.c index df191f2..00efec2 100644 --- a/diags/diag_nvme.c +++ b/diags/diag_nvme.c @@ -166,9 +166,9 @@ int main(int argc, char *argv[]) { } if (rc == 0) - fprintf(stdout, "Command completed successfully\n"); + fprintf(stdout, "NVMe diag command completed successfully\n"); else - fprintf(stderr, "Command failed, exiting with rc %d\n", rc); + fprintf(stderr, "NVMe diag command failed with rc %d\n", rc); return rc; } @@ -724,8 +724,11 @@ extern int get_smart_file(char *file_path, struct nvme_smart_log_page *log) { int num_elements = 0; struct dictionary dict[MAX_DICT_ELEMENTS]; - if ((num_elements = read_file_dict(file_path, dict, MAX_DICT_ELEMENTS)) < 0) + if ((num_elements = read_file_dict(file_path, dict, MAX_DICT_ELEMENTS)) < 0) { + fprintf(stderr, "read_file_dict failed: %s, rc % d\n", + file_path, num_elements); return num_elements; + } return set_smart_log_field(log, dict, num_elements); }