LWS_O_RDONLY to hide perversions
authorAndy Green <andy.green@linaro.org>
Thu, 10 Dec 2015 05:03:10 +0000 (13:03 +0800)
committerAndy Green <andy.green@linaro.org>
Thu, 10 Dec 2015 05:03:10 +0000 (13:03 +0800)
Signed-off-by: Andy Green <andy.green@linaro.org>
lib/libwebsockets.h
test-server/test-server-http.c

index f930485..eba16a1 100644 (file)
@@ -179,11 +179,13 @@ extern "C" {
 #endif
        
 #define LWS_INVALID_FILE INVALID_HANDLE_VALUE
+#define LWS_O_RDONLY _O_RDONLY
 
 #else /* NOT WIN32 */
 #include <unistd.h>
        
 #define LWS_INVALID_FILE -1
+#define LWS_O_RDONLY O_RDONLY
 
 #ifndef MBED_OPERATORS
 #include <poll.h>
index c9d635c..1ff6449 100644 (file)
@@ -168,7 +168,7 @@ int callback_http(struct lws_context *context, struct lws *wsi,
 
                        pss->fd = lws_plat_file_open(lws_get_fops(context),
                                                     leaf_path, &file_len,
-                                                    O_RDONLY);
+                                                    LWS_O_RDONLY);
 
                        if (pss->fd == LWS_INVALID_FILE)
                                return -1;