Pass cb_arg to discover_client_init
authorGeoff Levand <geoffrey.levand@am.sony.com>
Mon, 16 Feb 2009 06:57:13 +0000 (22:57 -0800)
committerJeremy Kerr <jk@ozlabs.org>
Sat, 21 Feb 2009 03:33:58 +0000 (14:33 +1100)
Pass the client cb_arg to discover_client_init() and have it
initialize the structure member.

Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
ui/common/discover-client.c
ui/common/discover-client.h
ui/test/pb-test.c

index 8672ae019d54f3e2121742cdfb125908e5be3059..6b991b14791a8b85beb3cfe5f19ab98a2d1a9593 100644 (file)
@@ -33,7 +33,7 @@ static int discover_client_destructor(void *arg)
 }
 
 struct discover_client* discover_client_init(
-       const struct discover_client_ops *ops)
+       const struct discover_client_ops *ops, void *cb_arg)
 {
        struct discover_client *client;
        struct sockaddr_un addr;
@@ -43,6 +43,7 @@ struct discover_client* discover_client_init(
                return NULL;
 
        memcpy(&client->ops, ops, sizeof(client->ops));
+       client->ops.cb_arg = cb_arg;
 
        client->fd = socket(AF_UNIX, SOCK_STREAM, 0);
        if (!client->fd < 0) {
index 719f72ab15e6d99dd00b26aedd4223c50c8724a2..fdcf93054bb1a0b8e716f263ab4ba41b176843a0 100644 (file)
@@ -19,7 +19,7 @@ struct discover_client_ops {
 };
 
 struct discover_client *discover_client_init(
-       const struct discover_client_ops *ops);
+       const struct discover_client_ops *ops, void *cb_arg);
 
 int discover_client_get_fd(const struct discover_client *client);
 
index b32944f0cbceac747a727e51bee959be3672ad2c..a1e3007c46ff8ddc21d9250d09f41c16d3c60130 100644 (file)
@@ -45,7 +45,7 @@ int main(void)
 {
        struct discover_client *client;
 
-       client = discover_client_init(&client_ops);
+       client = discover_client_init(&client_ops, NULL);
        if (!client)
                return -1;