From 5960158958a76c779eace665cbdb253fbc9b1bb5 Mon Sep 17 00:00:00 2001
From: Andy Green <andy.green@linaro.org>
Date: Tue, 15 Mar 2016 21:49:32 +0800
Subject: [PATCH] clang fixes 1

https://github.com/warmcat/libwebsockets/issues/461

Signed-off-by: Andy Green <andy.green@linaro.org>
---
 lib/service.c                      | 2 ++
 test-server/test-server-pthreads.c | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/lib/service.c b/lib/service.c
index bec262d9..4c297355 100644
--- a/lib/service.c
+++ b/lib/service.c
@@ -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;
diff --git a/test-server/test-server-pthreads.c b/test-server/test-server-pthreads.c
index ed61419d..1870ae83 100644
--- a/test-server/test-server-pthreads.c
+++ b/test-server/test-server-pthreads.c
@@ -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 */
-- 
GitLab