[ClusterLabs Developers] [PATCH] libqb: Add support for GNU/Hurd

Svante Signell svante.signell at gmail.com
Wed Mar 2 16:35:29 UTC 2016


On Wed, 2016-03-02 at 16:50 +0100, Jan Pokorný wrote:
> On 02/03/16 14:56 +0100, Svante Signell wrote:
> > On Wed, 2016-03-02 at 14:25 +0100, Jan Pokorný wrote:
> > > On 02/03/16 11:21 +0100, Svante Signell wrote:
> > > > Attached is an updated patch, the previous one was wrong, since GNU/Hurd
> > > > does
> > > > not support abstract sockets.
> > > 
> > > Fix the whitespace error mentioned in-line below first, please.
> > 
> > Done, new patch attached.
> 
> I created a separate pull request on your behalf:
> https://github.com/ClusterLabs/libqb/pull/192
> 
> with the expectation that the original one is hence obsolete.

Yes, it is now obsolete.

> Or was my understanding that the second original patch is no longer
> needed just a wrong assumption?

Right, since Linux and Cygwin use abstract sockets, that patch is also obsolete.

> Do you think unlink part is still relevant?

I don't really know, when running the test suite in amd64 with gcc-5.3.1-8, -10
all tests passes, even ipc.test. However, printing out the bind name as in the
diff below, all output contains an empty string. Maybe that is due to that path
names for abstract sockets start with the \0 character?

diff --git a/lib/ipc_setup.c b/lib/ipc_setup.c
index 700de94..6ebe82b 100644
--- a/lib/ipc_setup.c
+++ b/lib/ipc_setup.c
@@ -555,6 +555,7 @@ qb_ipcs_us_publish(struct qb_ipcs_service * s)
 
        res = bind(s->server_sock, (struct sockaddr *)&un_addr,
                   QB_SUN_LEN(&un_addr));
+       qb_util_log(LOG_INFO, "qb_ipcs_us_publish:bind(): res=%d,
un_addr.sun_path='%s'", res, un_addr.sun_path);
        if (res) {
                res = -errno;
                qb_util_perror(LOG_ERR, "Could not bind AF_UNIX (%s)",
diff --git a/lib/ipc_socket.c b/lib/ipc_socket.c
index 68ff5e5..f71fbb9 100644
--- a/lib/ipc_socket.c
+++ b/lib/ipc_socket.c
@@ -85,6 +85,7 @@ qb_ipc_dgram_sock_setup(const char *base_name,
 #endif
        res = bind(request_fd, (struct sockaddr *)&local_address,
                   sizeof(local_address));
+       qb_util_log(LOG_INFO, "qb_ipc_dgram_sock_setup:bind(): res=%d,
local_address.sun_path='%s'", res, local_address.sun_path);
 #if !(defined(QB_LINUX) || defined(QB_CYGWIN))
        chmod(local_address.sun_path, 0660);
        chown(local_address.sun_path, -1, gid);





More information about the Developers mailing list