mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-01-11 05:17:44 +03:00
Rename strbuf_cleanup to strbuf_free
It frees the whole object.
This commit is contained in:
parent
425ac7a253
commit
cfb1a0e555
@ -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;
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user