projects
/
platform
/
upstream
/
libwebsockets.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ed27be4
)
windows: cannot use fstat
author
Andy Green
<andy@warmcat.com>
Fri, 17 Mar 2017 03:43:45 +0000
(11:43 +0800)
committer
Andy Green
<andy@warmcat.com>
Fri, 17 Mar 2017 03:43:45 +0000
(11:43 +0800)
lib/server.c
patch
|
blob
|
history
diff --git
a/lib/server.c
b/lib/server.c
index
3c2e498
..
e5ba891
100644
(file)
--- a/
lib/server.c
+++ b/
lib/server.c
@@
-391,11
+391,17
@@
lws_http_serve(struct lws *wsi, char *uri, const char *origin,
/* if it can't be statted, don't try */
if (fflags & LWS_FOP_FLAG_VIRTUAL)
break;
-
+#if !defined(WIN32)
if (fstat(wsi->u.http.fop_fd->fd, &st)) {
lwsl_info("unable to stat %s\n", path);
goto bail;
}
+#else
+ if (stat(path, &st)) {
+ lwsl_info("unable to stat %s\n", path);
+ goto bail;
+ }
+#endif
wsi->u.http.fop_fd->mod_time = (uint32_t)st.st_mtime;
fflags |= LWS_FOP_FLAG_MOD_TIME_VALID;