aboutsummaryrefslogtreecommitdiff
path: root/compat/systemd.c
diff options
context:
space:
mode:
Diffstat (limited to 'compat/systemd.c')
-rw-r--r--compat/systemd.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/compat/systemd.c b/compat/systemd.c
index 7317e43a..cce42ed4 100644
--- a/compat/systemd.c
+++ b/compat/systemd.c
@@ -21,15 +21,23 @@
#include <systemd/sd-daemon.h>
+#include <string.h>
+
#include "tmux.h"
int
+systemd_activated(void)
+{
+ return (sd_listen_fds(0) >= 1);
+}
+
+int
systemd_create_socket(int flags, char **cause)
{
int fds;
int fd;
struct sockaddr_un sa;
- int addrlen = sizeof sa;
+ socklen_t addrlen = sizeof sa;
fds = sd_listen_fds(0);
if (fds > 1) { /* too many file descriptors */