]> git.ipfire.org Git - thirdparty/plymouth.git/commitdiff
protocol: change socket path
authorRay Strode <rstrode@redhat.com>
Wed, 6 Oct 2010 22:03:25 +0000 (18:03 -0400)
committerRay Strode <rstrode@redhat.com>
Wed, 6 Oct 2010 22:03:25 +0000 (18:03 -0400)
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.

src/client/ply-boot-client.c
src/ply-boot-protocol.h
src/ply-boot-server.c

index 5871a98872ac27956c3081ce4d9131807edbe21b..74979c9a2bc3c1976793e9f3de298383c5fffa8b 100644 (file)
@@ -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;
index 8b6d4fc71b25b11b2b17dedec6f024588a58572c..11aa1fb810fae9140d3ff483ef259193906d7f31 100644 (file)
@@ -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"
index 30d4b6468e6e608218786f0fbfceb3cdc4dd944e..b49f9b9f7d25a6db0f3057a96c548e7844318d44 100644 (file)
@@ -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;