clang fixes 1
authorAndy Green <andy.green@linaro.org>
Tue, 15 Mar 2016 13:49:32 +0000 (21:49 +0800)
committerAndy Green <andy.green@linaro.org>
Tue, 15 Mar 2016 13:49:32 +0000 (21:49 +0800)
https://github.com/warmcat/libwebsockets/issues/461

Signed-off-by: Andy Green <andy.green@linaro.org>
lib/service.c
test-server/test-server-pthreads.c

index bec262d..4c29735 100644 (file)
@@ -143,6 +143,8 @@ lws_handle_POLLOUT_event(struct lws *wsi, struct lws_pollfd *pollfd)
        /* Priority 6: user can get the callback
         */
        m = lws_ext_cb_active(wsi, LWS_EXT_CB_IS_WRITEABLE, NULL, 0);
+       if (m)
+               return -1;
 #ifndef LWS_NO_EXTENSIONS
        if (!wsi->extension_data_pending)
                goto user_service;
index ed61419..1870ae8 100644 (file)
@@ -360,7 +360,7 @@ int main(int argc, char **argv)
 
        /* wait for all the service threads to exit */
 
-       for (n = 0; n < lws_get_count_threads(context); n++)
+       while ((--n) >= 0)
                pthread_join(pthread_service[n], &retval);
 
        /* wait for pthread_dumb to exit */