summaryrefslogtreecommitdiff
path: root/src/basic/socket-label.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2017-12-27 18:22:31 +0100
committerLennart Poettering <lennart@poettering.net>2018-01-05 13:55:08 +0100
commit5b5e6deabb8b76bcd691c4e40429bd8478a49a32 (patch)
tree503fc8f657a968b9d68fdaad90229e35c96b4f1f /src/basic/socket-label.c
parent8b7f989a5824869a5ca9983b225758a8c2fd8f4a (diff)
downloadsystemd-5b5e6deabb8b76bcd691c4e40429bd8478a49a32.tar.gz
bus: touch() the AF_UNIX sockets we listen() on after the fact
We'd like to use inotify to get notified when AF_UNIX sockets become connectable. That happens at the moment of listen(), but this is doesn't necessarily create in a watchable inotify event. Hence, let's synthesize one whenever we generically create a socket, or when we know we created it for a D-Bus server. Ideally we wouldn't have to do this, and the kernel would generate an event anyway for this. Doing this explicitly isn't too bad however, as the event is still nicely associated with the AF_UNIX socket node, and we generate all D-Bus sockets in our code hence it's safe.
Diffstat (limited to 'src/basic/socket-label.c')
-rw-r--r--src/basic/socket-label.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/basic/socket-label.c b/src/basic/socket-label.c
index e67a5cfe6a..97f3ebe2af 100644
--- a/src/basic/socket-label.c
+++ b/src/basic/socket-label.c
@@ -142,6 +142,11 @@ int socket_address_listen(
if (listen(fd, backlog) < 0)
return -errno;
+ /* Let's trigger an inotify event on the socket node, so that anyone waiting for this socket to be connectable
+ * gets notified */
+ if (p)
+ (void) touch(p);
+
r = fd;
fd = -1;