projects
/
project
/
libubox.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
examples: use PRIu64 instead %lld when printing uint64_t values
[project/libubox.git]
/
examples
/
ustream-example.c
diff --git
a/examples/ustream-example.c
b/examples/ustream-example.c
index
68611c6
..
3db56c4
100644
(file)
--- a/
examples/ustream-example.c
+++ b/
examples/ustream-example.c
@@
-5,6
+5,7
@@
#include <getopt.h>
#include <stdlib.h>
#include <string.h>
#include <getopt.h>
#include <stdlib.h>
#include <string.h>
+#include <unistd.h>
#include "ustream.h"
#include "uloop.h"
#include "ustream.h"
#include "uloop.h"
@@
-23,7
+24,7
@@
struct client {
static void client_read_cb(struct ustream *s, int bytes)
{
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;
struct ustream_buf *buf = s->r.head;
char *newline, *str;
@@
-50,7
+51,7
@@
static void client_read_cb(struct ustream *s, int bytes)
static void client_close(struct ustream *s)
{
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);
fprintf(stderr, "Connection closed\n");
ustream_free(s);
@@
-70,7
+71,7
@@
static void client_notify_write(struct ustream *s, int bytes)
static void client_notify_state(struct ustream *s)
{
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;
if (!s->eof)
return;