From f0da04ca88975f0c0a06d6a0f6568b255c5e1cb3 Mon Sep 17 00:00:00 2001 From: Ray Strode Date: Wed, 6 Oct 2010 17:57:34 -0400 Subject: [PATCH] protocol: drop leading \0 from socket path The socket path is currently defined to be: #define PLY_BOOT_PROTOCOL_SOCKET_PATH "\0/ply-boot-protocol" The \0 is because it's an abstract socket, and abstract sockets have a leading NUL. The code always ignores the NUL though and adds it back later, so it's not needed. This commit just drops it. --- src/client/ply-boot-client.c | 2 +- src/ply-boot-protocol.h | 2 +- src/ply-boot-server.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/client/ply-boot-client.c b/src/client/ply-boot-client.c index 5fe30132..5871a988 100644 --- a/src/client/ply-boot-client.c +++ b/src/client/ply-boot-client.c @@ -180,7 +180,7 @@ ply_boot_client_connect (ply_boot_client_t *client, assert (client->disconnect_handler_user_data == NULL); client->socket_fd = - ply_connect_to_unix_socket (PLY_BOOT_PROTOCOL_SOCKET_PATH + 1, + ply_connect_to_unix_socket (PLY_BOOT_PROTOCOL_SOCKET_PATH, PLY_UNIX_SOCKET_TYPE_ABSTRACT); if (client->socket_fd < 0) diff --git a/src/ply-boot-protocol.h b/src/ply-boot-protocol.h index 97d5a421..8b6d4fc7 100644 --- a/src/ply-boot-protocol.h +++ b/src/ply-boot-protocol.h @@ -22,7 +22,7 @@ #ifndef PLY_BOOT_PROTOCOL_H #define PLY_BOOT_PROTOCOL_H -#define PLY_BOOT_PROTOCOL_SOCKET_PATH "\0/ply-boot-protocol" +#define PLY_BOOT_PROTOCOL_SOCKET_PATH "/ply-boot-protocol" #define PLY_BOOT_PROTOCOL_REQUEST_TYPE_PING "P" #define PLY_BOOT_PROTOCOL_REQUEST_TYPE_UPDATE "U" #define PLY_BOOT_PROTOCOL_REQUEST_TYPE_SYSTEM_INITIALIZED "S" diff --git a/src/ply-boot-server.c b/src/ply-boot-server.c index 337d22a4..30d4b646 100644 --- a/src/ply-boot-server.c +++ b/src/ply-boot-server.c @@ -179,7 +179,7 @@ ply_boot_server_listen (ply_boot_server_t *server) assert (server != NULL); server->socket_fd = - ply_listen_to_unix_socket (PLY_BOOT_PROTOCOL_SOCKET_PATH + 1, + ply_listen_to_unix_socket (PLY_BOOT_PROTOCOL_SOCKET_PATH, PLY_UNIX_SOCKET_TYPE_ABSTRACT); if (server->socket_fd < 0)