summaryrefslogtreecommitdiff
path: root/src/unit-name.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2010-10-13 03:57:04 +0200
committerLennart Poettering <lennart@poettering.net>2010-10-13 03:57:04 +0200
commit9fff8a1f165eb401f5411f96c755bb7704fdaa81 (patch)
tree69b40bc4da9f6b8962d14c9ebf989f23d0133e82 /src/unit-name.c
parent560d8f23811162542c1748f711ea6dce269d2720 (diff)
mount: hook in q fsck@.service instance for all mount points with passno > 0
Diffstat (limited to 'src/unit-name.c')
-rw-r--r--src/unit-name.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/unit-name.c b/src/unit-name.c
index cd6e3cea5c..dbaa4a7b12 100644
--- a/src/unit-name.c
+++ b/src/unit-name.c
@@ -377,6 +377,30 @@ char *unit_name_from_path(const char *path, const char *suffix) {
return r;
}
+char *unit_name_from_path_instance(const char *prefix, const char *path, const char *suffix) {
+ char *p, *r;
+
+ assert(path);
+ assert(suffix);
+
+ if (!(p = strdup(path)))
+ return NULL;
+
+ path_kill_slashes(p);
+
+ path = p[0] == '/' ? p + 1 : p;
+
+ if (path[0] == 0) {
+ free(p);
+ return unit_name_build_escape(prefix, "-", suffix);
+ }
+
+ r = unit_name_build_escape(prefix, path, suffix);
+ free(p);
+
+ return r;
+}
+
char *unit_name_to_path(const char *name) {
char *w, *e;