afb-socket: API name cares of abstract UDS
[src/app-framework-binder.git] / src / afb-socket.c
index ebbc58e..f4ee7e1 100644 (file)
@@ -217,7 +217,7 @@ static int open_systemd(const char *spec)
 {
 #if defined(NO_SYSTEMD_ACTIVATION)
        errno = EAFNOSUPPORT;
-       fd = -1;
+       return -1;
 #else
        return afb_systemd_fds_for(spec);
 #endif
@@ -366,9 +366,11 @@ const char *afb_socket_api(const char *uri)
 {
        int offset;
        const char *api;
+       struct entry *entry;
 
-       get_entry(uri, &offset);
+       entry = get_entry(uri, &offset);
        uri += offset;
+       uri += (entry->type == Type_Unix && *uri == '@');
        api = strstr(uri, as_api);
        if (api)
                api += sizeof as_api - 1;