summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorKarel Zak2018-06-20 16:41:51 +0200
committerKarel Zak2018-06-21 13:19:28 +0200
commit905bc7817ecae1df10e32bed2a0a68c11928ddc9 (patch)
treebbb1dba28fafcbf31dd2ab5619eab94e84ee856c /lib
parenttests: add simple ATA and NVME lsblk dump (diff)
downloadkernel-qcow2-util-linux-905bc7817ecae1df10e32bed2a0a68c11928ddc9.tar.gz
kernel-qcow2-util-linux-905bc7817ecae1df10e32bed2a0a68c11928ddc9.tar.xz
kernel-qcow2-util-linux-905bc7817ecae1df10e32bed2a0a68c11928ddc9.zip
lsblk: fix ul_path_read_string() usage
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/path.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/path.c b/lib/path.c
index cfc1c2372..602674956 100644
--- a/lib/path.c
+++ b/lib/path.c
@@ -1141,12 +1141,12 @@ int main(int argc, char *argv[])
errx(EXIT_FAILURE, "<file> not defined");
file = argv[optind++];
- if (ul_path_read_string(pc, &res, file) != 0)
- err(EXIT_FAILURE, "read u64 failed");
+ if (ul_path_read_string(pc, &res, file) < 0)
+ err(EXIT_FAILURE, "read string failed");
printf("read: %s: %s\n", file, res);
- if (ul_path_readf_string(pc, &res, "%s", file) != 0)
- err(EXIT_FAILURE, "readf u64 failed");
+ if (ul_path_readf_string(pc, &res, "%s", file) < 0)
+ err(EXIT_FAILURE, "readf string failed");
printf("readf: %s: %s\n", file, res);
} else if (strcmp(command, "read-link") == 0) {