]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
Rename strbuf_cleanup to strbuf_free
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 16 Feb 2021 16:05:42 +0000 (17:05 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 16 Feb 2021 16:15:11 +0000 (17:15 +0100)
It frees the whole object.

src/basic/strbuf.c
src/basic/strbuf.h
src/libsystemd/sd-hwdb/hwdb-util.c
src/libsystemd/sd-journal/catalog.c
src/test/test-strbuf.c

index 535ac58bed28c65a72d8a693fa9183ee456268d3..212b561fa645bb2fbcca76271d1f04402feb6576 100644 (file)
@@ -65,7 +65,7 @@ void strbuf_complete(struct strbuf *str) {
 }
 
 /* clean up everything */
-struct strbuf* strbuf_cleanup(struct strbuf *str) {
+struct strbuf* strbuf_free(struct strbuf *str) {
         if (!str)
                 return NULL;
 
index 9a21438d640a3ac92fa3133a87e41123689c922f..6187c0868322ab5ce9aaacd773624c23f7f2dfb7 100644 (file)
@@ -35,5 +35,5 @@ struct strbuf_child_entry {
 struct strbuf* strbuf_new(void);
 ssize_t strbuf_add_string(struct strbuf *str, const char *s, size_t len);
 void strbuf_complete(struct strbuf *str);
-struct strbuf* strbuf_cleanup(struct strbuf *str);
-DEFINE_TRIVIAL_CLEANUP_FUNC(struct strbuf*, strbuf_cleanup);
+struct strbuf* strbuf_free(struct strbuf *str);
+DEFINE_TRIVIAL_CLEANUP_FUNC(struct strbuf*, strbuf_free);
index 34be0e7fcc2e884daecd877b2b4c6e4c26ef8ec2..fd45ff0f548f2f7cc986ecc8a79ed1f80e426027 100644 (file)
@@ -120,7 +120,7 @@ static struct trie* trie_free(struct trie *trie) {
                 return NULL;
 
         trie_node_cleanup(trie->root);
-        strbuf_cleanup(trie->strings);
+        strbuf_free(trie->strings);
         return mfree(trie);
 }
 
index 0f6ad8a29e83113fec27dc3c52c159ff627052f7..aea3241d1853be26319d1ea518672972b08b9a2b 100644 (file)
@@ -444,7 +444,7 @@ error:
 int catalog_update(const char* database, const char* root, const char* const* dirs) {
         _cleanup_strv_free_ char **files = NULL;
         char **f;
-        _cleanup_(strbuf_cleanupp) struct strbuf *sb = NULL;
+        _cleanup_(strbuf_freep) struct strbuf *sb = NULL;
         _cleanup_ordered_hashmap_free_free_free_ OrderedHashmap *h = NULL;
         _cleanup_free_ CatalogItem *items = NULL;
         ssize_t offset;
index 867be19c86025df108cce59e8acccf05bcba1f25..0cdef3fb729fec904740808599eeb623d283ae69 100644 (file)
@@ -12,7 +12,7 @@ static ssize_t add_string(struct strbuf *sb, const char *s) {
 }
 
 static void test_strbuf(void) {
-        _cleanup_(strbuf_cleanupp) struct strbuf *sb;
+        _cleanup_(strbuf_freep) struct strbuf *sb;
         _cleanup_strv_free_ char **l;
         ssize_t a, b, c, d, e, f, g, h;