From: Ray Strode Date: Wed, 6 Oct 2010 22:03:25 +0000 (-0400) Subject: protocol: change socket path X-Git-Tag: 0.8.4~107^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3ec007a4820e53aed6713620173bd997957754ec;p=thirdparty%2Fplymouth.git protocol: change socket path Before we were using /ply-boot-protocol\0\0\0\0...\0 for our address which really uglifies /proc/net/unix and doesn't match what a lot of other programs do. This commit changes the address to just /org/freedesktop/plymouthd which is much nicer. --- diff --git a/src/client/ply-boot-client.c b/src/client/ply-boot-client.c index 5871a988..74979c9a 100644 --- a/src/client/ply-boot-client.c +++ b/src/client/ply-boot-client.c @@ -180,11 +180,20 @@ 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, - PLY_UNIX_SOCKET_TYPE_ABSTRACT); + ply_connect_to_unix_socket (PLY_BOOT_PROTOCOL_TRIMMED_ABSTRACT_SOCKET_PATH, + PLY_UNIX_SOCKET_TYPE_TRIMMED_ABSTRACT); if (client->socket_fd < 0) - return false; + { + ply_trace ("could not connect to " PLY_BOOT_PROTOCOL_TRIMMED_ABSTRACT_SOCKET_PATH ": %m"); + ply_trace ("trying old fallback path " PLY_BOOT_PROTOCOL_OLD_ABSTRACT_SOCKET_PATH); + + client->socket_fd = + ply_connect_to_unix_socket (PLY_BOOT_PROTOCOL_OLD_ABSTRACT_SOCKET_PATH, + PLY_UNIX_SOCKET_TYPE_ABSTRACT); + ply_trace ("could not connect to " PLY_BOOT_PROTOCOL_OLD_ABSTRACT_SOCKET_PATH ": %m"); + return false; + } client->disconnect_handler = disconnect_handler; client->disconnect_handler_user_data = user_data; diff --git a/src/ply-boot-protocol.h b/src/ply-boot-protocol.h index 8b6d4fc7..11aa1fb8 100644 --- a/src/ply-boot-protocol.h +++ b/src/ply-boot-protocol.h @@ -22,7 +22,8 @@ #ifndef PLY_BOOT_PROTOCOL_H #define PLY_BOOT_PROTOCOL_H -#define PLY_BOOT_PROTOCOL_SOCKET_PATH "/ply-boot-protocol" +#define PLY_BOOT_PROTOCOL_TRIMMED_ABSTRACT_SOCKET_PATH "/org/freedesktop/plymouthd" +#define PLY_BOOT_PROTOCOL_OLD_ABSTRACT_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 30d4b646..b49f9b9f 100644 --- a/src/ply-boot-server.c +++ b/src/ply-boot-server.c @@ -179,8 +179,8 @@ 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, - PLY_UNIX_SOCKET_TYPE_ABSTRACT); + ply_listen_to_unix_socket (PLY_BOOT_PROTOCOL_TRIMMED_ABSTRACT_SOCKET_PATH, + PLY_UNIX_SOCKET_TYPE_TRIMMED_ABSTRACT); if (server->socket_fd < 0) return false;