summaryrefslogtreecommitdiff
path: root/src/udev/udevadm-hwdb.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2014-02-17 08:39:47 -0500
committerAnthony G. Basile <blueness@gentoo.org>2014-02-21 10:05:22 -0500
commit9fa108ac48c9b76111589967184436bf63109731 (patch)
treea17d913ab78fdb340c1b7ce13c83563937cc316c /src/udev/udevadm-hwdb.c
parentc1db5c60e38fa4b1cd2c590dbc8ce95c4fc3844b (diff)
everywhere: make use of new0() and macro() macros, and stop using perror()
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
Diffstat (limited to 'src/udev/udevadm-hwdb.c')
-rw-r--r--src/udev/udevadm-hwdb.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/udev/udevadm-hwdb.c b/src/udev/udevadm-hwdb.c
index 614c64789c..61662fb4ae 100644
--- a/src/udev/udevadm-hwdb.c
+++ b/src/udev/udevadm-hwdb.c
@@ -197,7 +197,7 @@ static int trie_insert(struct trie *trie, struct trie_node *node, const char *se
continue;
/* split node */
- new_child = calloc(sizeof(struct trie_node), 1);
+ new_child = new0(struct trie_node, 1);
if (!new_child)
return -ENOMEM;
@@ -240,7 +240,7 @@ static int trie_insert(struct trie *trie, struct trie_node *node, const char *se
ssize_t off;
/* new child */
- child = calloc(sizeof(struct trie_node), 1);
+ child = new0(struct trie_node, 1);
if (!child)
return -ENOMEM;
@@ -583,7 +583,7 @@ static int adm_hwdb(struct udev *udev, int argc, char *argv[]) {
char **files, **f;
_cleanup_free_ char *hwdb_bin = UDEV_HWDB_BIN;
- trie = calloc(sizeof(struct trie), 1);
+ trie = new0(struct trie, 1);
if (!trie) {
rc = EXIT_FAILURE;
goto out;
@@ -597,7 +597,7 @@ static int adm_hwdb(struct udev *udev, int argc, char *argv[]) {
}
/* index */
- trie->root = calloc(sizeof(struct trie_node), 1);
+ trie->root = new0(struct trie_node, 1);
if (!trie->root) {
rc = EXIT_FAILURE;
goto out;