From 4edb452969caa507834061d097bc88ea9dc88f1f Mon Sep 17 00:00:00 2001 From: Andy Green Date: Mon, 15 Dec 2014 15:08:13 +0800 Subject: [PATCH] clean unmix declarations and code Signed-off-by: Andy Green --- lib/pollfd.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/lib/pollfd.c b/lib/pollfd.c index db7ae4a..b09127e 100644 --- a/lib/pollfd.c +++ b/lib/pollfd.c @@ -131,16 +131,19 @@ do_ext: int lws_change_pollfd(struct libwebsocket *wsi, int _and, int _or) { - if (!wsi || !wsi->protocol || wsi->position_in_fds_table < 0) - return 1; - struct libwebsocket_context *context = wsi->protocol->owning_server; - if (!context) - return 1; + struct libwebsocket_context *context; int tid; int sampled_tid; struct libwebsocket_pollfd *pfd; struct libwebsocket_pollargs pa; + if (!wsi || !wsi->protocol || wsi->position_in_fds_table < 0) + return 1; + + context = wsi->protocol->owning_server; + if (!context) + return 1; + pfd = &context->fds[wsi->position_in_fds_table]; pa.fd = wsi->sock; -- 2.7.4