From 7b8d09e62eff4d4db7d80c523fd4e1a4acda1075 Mon Sep 17 00:00:00 2001 From: Rafael Fonseca Date: Fri, 24 Nov 2017 17:22:30 +0100 Subject: [PATCH] ziomon: fix typo when checking for attribute existence Fix possible c&p mistake when checking the presence of `queue_full` attribute in old kernels. There should be no impact on how the tool works other than exiting gracefully in case the attribute does not exist. Fixes: #21 Signed-off-by: Rafael Fonseca Signed-off-by: Steffen Maier Signed-off-by: Michael Holzheu --- ziomon/ziomon_util.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ziomon/ziomon_util.c b/ziomon/ziomon_util.c index 62038992..08e9cd36 100644 --- a/ziomon/ziomon_util.c +++ b/ziomon/ziomon_util.c @@ -662,7 +662,7 @@ static int init_adapters(struct adapters *all_adapters, struct options *opts) malloc(sizeof(char)*MAX_HOST_PATH_LEN); sprintf(adapter->q_full_path, "%s/queue_full", opts->host_path[i]); - if (stat(adapter->path, &buf)) { + if (stat(adapter->q_full_path, &buf)) { fprintf(stderr, "%s: Path does not exist: %s - correct kernel version?\n", toolname, adapter->q_full_path); rc++; @@ -806,7 +806,7 @@ static int check_host_param(long *host_nr, char *host_path) } tmp = malloc(strlen(host_path) + strlen("/queue_full") + 1); sprintf(tmp, "%s/queue_full", host_path); - if (stat(host_path, &buf)) { + if (stat(tmp, &buf)) { fprintf(stderr, "%s: Cannot access %s." " Your installed kernel is probably too old. Please" " check that your kernel matches the level in the"