aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Bühler <stbuehler@web.de>2009-02-03 18:16:13 +0100
committerStefan Bühler <stbuehler@web.de>2009-02-03 18:16:13 +0100
commit030d82f35a3ed14d467a03478a94b3c624481da8 (patch)
tree2edf05a57ef6a6150d5f0044071a78cabe3415d7
parent135d8dd7a40a7bfc40d49e98f07456c7202bd63b (diff)
downloadfcgi-debug-030d82f35a3ed14d467a03478a94b3c624481da8.tar.gz
fcgi-debug-030d82f35a3ed14d467a03478a94b3c624481da8.zip
Fix some warnings (libev mess)
-rw-r--r--src/fcgi-debug.c23
-rw-r--r--src/stream.c9
2 files changed, 20 insertions, 12 deletions
diff --git a/src/fcgi-debug.c b/src/fcgi-debug.c
index a2fbeea..b644e95 100644
--- a/src/fcgi-debug.c
+++ b/src/fcgi-debug.c
@@ -15,10 +15,11 @@ static void accept_cb(struct ev_loop *loop, struct ev_io *w, int revents) {
}
#define CATCH_SIGNAL(loop, cb, n) do {\
- ev_init(&srv->sig_w_##n, cb); \
- ev_signal_set(&srv->sig_w_##n, SIG##n); \
- ev_signal_start(loop, &srv->sig_w_##n); \
- srv->sig_w_##n.data = srv; \
+ struct ev_signal *ws = &srv->sig_w_##n; \
+ ev_init(ws, cb); \
+ ev_signal_set(ws, SIG##n); \
+ ev_signal_start(loop, ws); \
+ ws->data = srv; \
ev_unref(loop); /* Signal watchers shouldn't keep loop alive */ \
} while (0)
@@ -170,13 +171,19 @@ int main(int argc, char **argv) {
ch = spawn(argv, s);
srv->child = ch;
- ev_child_init(&srv->w_child, child_cb, ch, 0);
- srv->w_child.data = srv;
+ {
+ ev_child *w = &srv->w_child;
+ ev_child_init(w, child_cb, ch, 0);
+ w->data = srv;
+ }
ev_child_start(srv->loop, &srv->w_child);
fd_init(0);
- ev_io_init(&srv->w_accept, accept_cb, 0, EV_READ);
- srv->w_accept.data = srv;
+ {
+ ev_io *w = &srv->w_accept;
+ ev_io_init(w, accept_cb, 0, EV_READ);
+ w->data = srv;
+ }
ev_io_start(srv->loop, &srv->w_accept);
ev_loop(srv->loop, 0);
diff --git a/src/stream.c b/src/stream.c
index d6c99ca..aad06a0 100644
--- a/src/stream.c
+++ b/src/stream.c
@@ -8,10 +8,11 @@ void stream_init(server *srv, stream *s1, stream *s2, int fd1, int fd2, ev_io_cb
s2->other = s1;
s1->fd = fd1;
s2->fd = fd2;
- ev_io_init(&s1->watcher, cb1, fd1, 0);
- ev_io_init(&s2->watcher, cb2, fd2, 0);
- s1->watcher.data = data;
- s2->watcher.data = data;
+ ev_io *w1 = &s1->watcher, *w2 = &s2->watcher;
+ ev_io_init(w1, cb1, fd1, 0);
+ ev_io_init(w2, cb2, fd2, 0);
+ w1->data = data;
+ w2->data = data;
s1->buffer = g_string_sized_new(0);
s2->buffer = g_string_sized_new(0);
}