chiark / gitweb /
Use @ instead = as abstract namespace socket prefix
authorLennart Poettering <lennart@poettering.net>
Thu, 28 Jan 2010 03:50:28 +0000 (04:50 +0100)
committerLennart Poettering <lennart@poettering.net>
Thu, 28 Jan 2010 03:50:28 +0000 (04:50 +0100)
@ makes more sense since the NUL addr contained in the sockaddr's
sun_path field can also be written as ^@.

Also, in the .socket files writing "ListenStream==foo" is kinda ugly.

Finally, tools like strace decode it with an @ too.

socket-util.c
test1/systemd-logger.socket

index 46a6e91..0282dd2 100644 (file)
@@ -69,7 +69,7 @@ int socket_address_parse(SocketAddress *a, const char *s) {
                 memcpy(a->sockaddr.un.sun_path, s, l);
                 a->size = sizeof(sa_family_t) + l + 1;
 
-        } else if (*s == '=') {
+        } else if (*s == '@') {
                 /* Abstract AF_UNIX socket */
                 size_t l;
 
@@ -261,7 +261,7 @@ int socket_address_print(const SocketAddress *a, char **p) {
                                 if (!(ret = new(char, sizeof(a->sockaddr.un.sun_path)+1)))
                                         return -ENOMEM;
 
-                                ret[0] = '=';
+                                ret[0] = '@';
                                 memcpy(ret+1, a->sockaddr.un.sun_path+1, sizeof(a->sockaddr.un.sun_path)-1);
                                 ret[sizeof(a->sockaddr.un.sun_path)] = 0;
 
index 3f05363..c964ab7 100644 (file)
@@ -2,4 +2,4 @@
 Description=systemd Logging Socket
 
 [Socket]
-ListenStream==/systemd/logger
+ListenStream=@/systemd/logger