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 <r4f4rfs@gmail.com>
Signed-off-by: Steffen Maier <maier@linux.vnet.ibm.com>
Signed-off-by: Michael Holzheu <holzheu@linux.vnet.ibm.com>
This commit is contained in:
Rafael Fonseca
2017-11-24 17:22:30 +01:00
committed by Michael Holzheu
parent 5a8eee163b
commit 7b8d09e62e

View File

@@ -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"