ustream-example: fix container_of type errors
authorFelix Fietkau <nbd@openwrt.org>
Wed, 8 May 2013 23:06:40 +0000 (01:06 +0200)
committerFelix Fietkau <nbd@openwrt.org>
Wed, 8 May 2013 23:06:55 +0000 (01:06 +0200)
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
examples/ustream-example.c

index 68611c6fb0ad7ad2eaf944bf3f375cfa98ddb568..88c7381040c469af74bb922b0b7ede14f9be99e0 100644 (file)
@@ -23,7 +23,7 @@ struct client {
 
 static void client_read_cb(struct ustream *s, int bytes)
 {
-       struct client *cl = container_of(s, struct client, s);
+       struct client *cl = container_of(s, struct client, s.stream);
        struct ustream_buf *buf = s->r.head;
        char *newline, *str;
 
@@ -50,7 +50,7 @@ static void client_read_cb(struct ustream *s, int bytes)
 
 static void client_close(struct ustream *s)
 {
-       struct client *cl = container_of(s, struct client, s);
+       struct client *cl = container_of(s, struct client, s.stream);
 
        fprintf(stderr, "Connection closed\n");
        ustream_free(s);
@@ -70,7 +70,7 @@ static void client_notify_write(struct ustream *s, int bytes)
 
 static void client_notify_state(struct ustream *s)
 {
-       struct client *cl = container_of(s, struct client, s);
+       struct client *cl = container_of(s, struct client, s.stream);
 
        if (!s->eof)
                return;