summaryrefslogtreecommitdiff
path: root/socket-util.c
diff options
context:
space:
mode:
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);
}