From 29283ea4cf5df20aa0ea9e24e3cb7035bf4c4a04 Mon Sep 17 00:00:00 2001 From: Michal Sekletar Date: Fri, 13 Jul 2012 15:59:26 +0200 Subject: systemd: enable/disable instances of template https://bugzilla.redhat.com/show_bug.cgi?id=752774 --- src/shared/unit-name.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/shared/unit-name.c') diff --git a/src/shared/unit-name.c b/src/shared/unit-name.c index fcf5902c78..e8328c321a 100644 --- a/src/shared/unit-name.c +++ b/src/shared/unit-name.c @@ -341,6 +341,18 @@ bool unit_name_is_template(const char *n) { return p[1] == '.'; } +bool unit_name_is_instance(const char *n) { + const char *p; + + assert(n); + + p = strchr(n, '@'); + if (!p) + return false; + + return p[1] != '.'; +} + char *unit_name_replace_instance(const char *f, const char *i) { const char *p, *e; char *r, *k; -- cgit v1.2.1