use compatible_close for sockets
authorAndy Green <andy.green@linaro.org>
Mon, 21 Oct 2013 22:49:30 +0000 (06:49 +0800)
committerAndy Green <andy.green@linaro.org>
Mon, 21 Oct 2013 22:49:30 +0000 (06:49 +0800)
Signed-off-by: Andy Green <andy.green@linaro.org>
lib/libwebsockets.c

index 7e7a7b2..b759b39 100644 (file)
@@ -2174,7 +2174,7 @@ libwebsocket_create_context(struct lws_context_creation_info *info)
                if (n < 0) {
                        lwsl_err("ERROR on binding to port %d (%d %d)\n",
                                                        info->port, n, errno);
-                       close(sockfd);
+                       compatible_close(sockfd);
                        goto bail;
                }
 
@@ -2182,7 +2182,7 @@ libwebsocket_create_context(struct lws_context_creation_info *info)
                                        sizeof(struct libwebsocket));
                if (wsi == NULL) {
                        lwsl_err("Out of mem\n");
-                       close(sockfd);
+                       compatible_close(sockfd);
                        goto bail;
                }
                memset(wsi, 0, sizeof(struct libwebsocket));