summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: ac0af6c)
raw | patch | inline | side by side (parent: ac0af6c)
author | Florian Forster <octo@collectd.org> | |
Fri, 17 Nov 2017 14:09:59 +0000 (15:09 +0100) | ||
committer | Florian Forster <octo@collectd.org> | |
Fri, 17 Nov 2017 14:09:59 +0000 (15:09 +0100) |
CID: 42796
src/zfs_arc.c | patch | blob | history |
diff --git a/src/zfs_arc.c b/src/zfs_arc.c
index e589184c2cf0fe6b898762270a47462c33d299fa..5d37f9f1e0078ab73d3581138c55a1c18fc7be77 100644 (file)
--- a/src/zfs_arc.c
+++ b/src/zfs_arc.c
return -1;
}
- ksp = llist_create();
- if (ksp == NULL) {
- ERROR("zfs_arc plugin: `llist_create' failed.");
- fclose(fh);
- return -1;
- }
-
- // Ignore the first two lines because they contain information about
- // the rest of the file.
- // See kstat_seq_show_headers module/spl/spl-kstat.c of the spl kernel
- // module.
- if (fgets(buffer, sizeof(buffer), fh) == NULL) {
- ERROR("zfs_arc plugin: \"%s\" does not contain a single line.",
+ /* Ignore the first two lines because they contain information about the rest
+ * of the file.
+ * See kstat_seq_show_headers module/spl/spl-kstat.c of the spl kernel module.
+ */
+ if ((fgets(buffer, sizeof(buffer), fh) == NULL) ||
+ (fgets(buffer, sizeof(buffer), fh) == NULL)) {
+ ERROR("zfs_arc plugin: \"%s\" does not contain at least two lines.",
ZOL_ARCSTATS_FILE);
fclose(fh);
return -1;
}
- if (fgets(buffer, sizeof(buffer), fh) == NULL) {
- ERROR("zfs_arc plugin: \"%s\" does not contain at least two lines.",
- ZOL_ARCSTATS_FILE);
+
+ ksp = llist_create();
+ if (ksp == NULL) {
+ ERROR("zfs_arc plugin: `llist_create' failed.");
fclose(fh);
return -1;
}