diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2015-08-05 21:01:06 -0400 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2015-08-05 21:02:41 -0400 |
commit | 73974f6768ef5314a572eb93f5cfc7f0f29c9549 (patch) | |
tree | e95c0a5626290c79e7c31ac143e6c75a0f167d9d /src/basic/util.h | |
parent | 4306d66f594722a2fe44b034d3c68bfb864c6a76 (diff) | |
parent | 90365b043ab6a0d8100e0c37dea4ca9d6fdb4695 (diff) |
Merge branch 'hostnamectl-dot-v2'
Manual merge of https://github.com/systemd/systemd/pull/751.
Diffstat (limited to 'src/basic/util.h')
-rw-r--r-- | src/basic/util.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/basic/util.h b/src/basic/util.h index 0a0fba9012..426b7f7d16 100644 --- a/src/basic/util.h +++ b/src/basic/util.h @@ -864,6 +864,11 @@ int unquote_first_word(const char **p, char **ret, UnquoteFlags flags); int unquote_first_word_and_warn(const char **p, char **ret, UnquoteFlags flags, const char *unit, const char *filename, unsigned line, const char *rvalue); int unquote_many_words(const char **p, UnquoteFlags flags, ...) _sentinel_; +static inline void free_and_replace(char **s, char *v) { + free(*s); + *s = v; +} + int free_and_strdup(char **p, const char *s); #define INOTIFY_EVENT_MAX (sizeof(struct inotify_event) + NAME_MAX + 1) |