summaryrefslogtreecommitdiff
path: root/src/udev/udevadm-hwdb.c
diff options
context:
space:
mode:
authorKacper Kowalik (Xarthisius) <xarthisius@gentoo.org>2012-11-18 10:49:47 +0100
committerAnthony G. Basile <blueness@gentoo.org>2012-11-18 10:14:19 -0500
commitc189ab04cbaa2f011da0210f2c885e6f693f1d6c (patch)
treee013ea0467292d81b5318106985d3bfeec6a333f /src/udev/udevadm-hwdb.c
parent2af83cafa0f410edc1d60029edfd457e121114a4 (diff)
Fix unused result warnings
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
Diffstat (limited to 'src/udev/udevadm-hwdb.c')
-rw-r--r--src/udev/udevadm-hwdb.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/udev/udevadm-hwdb.c b/src/udev/udevadm-hwdb.c
index 02d8d01f8a..e545689f3d 100644
--- a/src/udev/udevadm-hwdb.c
+++ b/src/udev/udevadm-hwdb.c
@@ -313,12 +313,14 @@ static int64_t trie_store_nodes(struct trie_f *trie, struct trie_node *node) {
/* write node */
node_off = ftello(trie->f);
- fwrite(&n, sizeof(struct trie_node_f), 1, trie->f);
+ if (fwrite(&n, sizeof(struct trie_node_f), 1, trie->f) != 1)
+ log_error("Failed to write sizeof struct trie_node_f to n in %s\n", "[udevadm-hwdb.c:trie_store_nodes]");
trie->nodes_count++;
/* append children array */
if (node->children_count) {
- fwrite(children, sizeof(struct trie_child_entry_f), node->children_count, trie->f);
+ if (fwrite(children, sizeof(struct trie_child_entry_f), node->children_count, trie->f) != node->children_count)
+ log_error("Failed to write children_count in %s\n", "[udevadm-hwdb.c:trie_store_nodes]");
trie->children_count += node->children_count;
free(children);
}
@@ -330,7 +332,8 @@ static int64_t trie_store_nodes(struct trie_f *trie, struct trie_node *node) {
.value_off = htole64(trie->strings_off + node->values[i].value_off),
};
- fwrite(&v, sizeof(struct trie_value_entry_f), 1, trie->f);
+ if (fwrite(&v, sizeof(struct trie_value_entry_f), 1, trie->f) != 1)
+ log_error("Failed to write sizeof trie_value_entry_f to v in %s\n", "[udevadm-hwdb.c:trie_store_nodes]");
trie->values_count++;
}
@@ -372,14 +375,16 @@ static int trie_store(struct trie *trie, const char *filename) {
h.nodes_len = htole64(pos - sizeof(struct trie_header_f));
/* write string buffer */
- fwrite(trie->strings->buf, trie->strings->len, 1, t.f);
+ if (fwrite(trie->strings->buf, trie->strings->len, 1, t.f) != 1)
+ log_error("Failed to write into trie->strings->buf in %s\n", "[udevadm-hwdb.c:trie_store]");
h.strings_len = htole64(trie->strings->len);
/* write header */
size = ftello(t.f);
h.file_size = htole64(size);
fseeko(t.f, 0, SEEK_SET);
- fwrite(&h, sizeof(struct trie_header_f), 1, t.f);
+ if (fwrite(&h, sizeof(struct trie_header_f), 1, t.f) != 1)
+ log_error("Failed to write into h in %s\n", "[udevadm-hwdb.c:trie_store]");
err = ferror(t.f);
if (err)
err = -errno;