summaryrefslogtreecommitdiff
path: root/socket-util.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2010-05-13 03:07:16 +0200
committerLennart Poettering <lennart@poettering.net>2010-05-13 03:07:16 +0200
commit6e2ef85b2572af82a0ce035516d65218bdc80fa4 (patch)
tree3c677c6168301ddd8762186bac7f8bcf1288f46c /socket-util.c
parentafb757b1a8a416b3c692728330a266b3915eef41 (diff)
units: rework automatic dependency logic between automounts, mounts, sockets, swaps
Diffstat (limited to 'socket-util.c')
-rw-r--r--socket-util.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/socket-util.c b/socket-util.c
index 8141ab09eb..32f6bcb941 100644
--- a/socket-util.c
+++ b/socket-util.c
@@ -453,5 +453,16 @@ bool socket_address_is(const SocketAddress *a, const char *s) {
return false;
return socket_address_equal(a, &b);
+}
+
+bool socket_address_needs_mount(const SocketAddress *a, const char *prefix) {
+ assert(a);
+
+ if (socket_address_family(a) != AF_UNIX)
+ return false;
+
+ if (a->sockaddr.un.sun_path[0] == 0)
+ return false;
+ return path_startswith(a->sockaddr.un.sun_path, prefix);
}