windows: cannot use fstat

This commit is contained in:
Andy Green 2017-03-17 11:44:47 +08:00
parent f8a995e8d5
commit b4d2ad04bd

View file

@ -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;