]> git.ipfire.org Git - thirdparty/plymouth.git/commitdiff
protocol: drop leading \0 from socket path
authorRay Strode <rstrode@redhat.com>
Wed, 6 Oct 2010 21:57:34 +0000 (17:57 -0400)
committerRay Strode <rstrode@redhat.com>
Wed, 6 Oct 2010 21:57:34 +0000 (17:57 -0400)
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
src/ply-boot-protocol.h
src/ply-boot-server.c

index 5fe301326c0c1853941e2d0a8d898938c13accf9..5871a98872ac27956c3081ce4d9131807edbe21b 100644 (file)
@@ -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)
index 97d5a42127eb0eedb16ec02ea953a60dafc9ef80..8b6d4fc71b25b11b2b17dedec6f024588a58572c 100644 (file)
@@ -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"
index 337d22a4c0cb5a20d6525852ea1617145e1b6b37..30d4b6468e6e608218786f0fbfceb3cdc4dd944e 100644 (file)
@@ -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)