Pass both ABSTRACT_SOCKET and PATHNAME_SOCKET to the compiler at
build time, and listen on both sockets by default.

Signed-off-by: Martin Wilck <[email protected]>
---
 Makefile.inc            |  2 +-
 libmpathcmd/mpath_cmd.c |  2 +-
 multipathd/main.c       | 11 ++++++-----
 3 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/Makefile.inc b/Makefile.inc
index d0fecc3..9e3dc46 100644
--- a/Makefile.inc
+++ b/Makefile.inc
@@ -118,7 +118,7 @@ CPPFLAGS    := $(FORTIFY_OPT) $(CPPFLAGS) $(D_URCU_VERSION) 
\
                   -DRUNTIME_DIR=\"$(runtimedir)\" 
-DCONFIG_DIR=\"$(TGTDIR)$(configdir)\" \
                   -DDEFAULT_CONFIGFILE=\"$(TGTDIR)$(configfile)\" 
-DSTATE_DIR=\"$(TGTDIR)$(statedir)\" \
                   -DEXTRAVERSION=\"$(EXTRAVERSION)\" \
-                  -DDEFAULT_SOCKET=\"$(abstract_socket)\" \
+                  -DABSTRACT_SOCKET=\"$(abstract_socket)\" 
-DPATHNAME_SOCKET=\"$(pathname_socket)\" \
                   -DWSTRINGOP_TRUNCATION=$(if $(WSTRINGOP_TRUNCATION),1,0) \
                   -MMD -MP
 CFLAGS         := -std=$(C_STD) $(CFLAGS) $(OPTFLAGS) $(WARNFLAGS) -pipe \
diff --git a/libmpathcmd/mpath_cmd.c b/libmpathcmd/mpath_cmd.c
index 5a39471..c7cf954 100644
--- a/libmpathcmd/mpath_cmd.c
+++ b/libmpathcmd/mpath_cmd.c
@@ -113,7 +113,7 @@ int mpath_connect__(int nonblocking)
                        (void)fcntl(fd, F_SETFL, flags|O_NONBLOCK);
        }
 
-       len = mpath_fill_sockaddr__(&addr, DEFAULT_SOCKET);
+       len = mpath_fill_sockaddr__(&addr, ABSTRACT_SOCKET);
        if (connect(fd, (struct sockaddr *)&addr, len) == -1) {
                int err = errno;
 
diff --git a/multipathd/main.c b/multipathd/main.c
index ac204b2..b41c181 100644
--- a/multipathd/main.c
+++ b/multipathd/main.c
@@ -1899,13 +1899,14 @@ uxlsnrloop (void * ap)
        pthread_cleanup_push(rcu_unregister, NULL);
        rcu_register_thread();
 
-       num = get_systemd_sockets(&ux_sock);
+       num = get_systemd_sockets(ux_sock);
        if (num < 1) {
-               ux_sock[0] = ux_socket_listen(DEFAULT_SOCKET);
-               num = 1;
+               ux_sock[0] = ux_socket_listen(ABSTRACT_SOCKET);
+               ux_sock[1] = ux_socket_listen(PATHNAME_SOCKET);
+               num = 2;
        }
-       if (ux_sock[0] == -1) {
-               condlog(1, "could not create uxsock: %d", errno);
+       if (ux_sock[0] == -1 && ux_sock[1] == -1) {
+               condlog(1, "could not create sockets: %d", errno);
                exit_daemon();
                goto out;
        }
-- 
2.48.1


Reply via email to