Browse Source

Fix some warnings (libev mess)

master
Stefan Bühler 13 years ago
parent
commit
030d82f35a
  1. 23
      src/fcgi-debug.c
  2. 9
      src/stream.c

23
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);

9
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);
}

Loading…
Cancel
Save