mirror of
https://github.com/cesanta/mongoose.git
synced 2025-08-01 10:26:14 +08:00
Redefine mkdir only if MG_ENABLE_POSIX_FS==0
This commit is contained in:
parent
8b6e02e985
commit
6a3e1e41c4
@ -211,11 +211,14 @@ static inline void *mg_calloc(size_t cnt, size_t size) {
|
|||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if MG_ENABLE_POSIX_FS
|
||||||
|
#else
|
||||||
#define mkdir(a, b) mg_mkdir(a, b)
|
#define mkdir(a, b) mg_mkdir(a, b)
|
||||||
static inline int mg_mkdir(const char *path, mode_t mode) {
|
static inline int mg_mkdir(const char *path, mode_t mode) {
|
||||||
(void) path, (void) mode;
|
(void) path, (void) mode;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif // MG_ARCH == MG_ARCH_FREERTOS
|
#endif // MG_ARCH == MG_ARCH_FREERTOS
|
||||||
|
|
||||||
|
@ -37,10 +37,13 @@ static inline void *mg_calloc(size_t cnt, size_t size) {
|
|||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if MG_ENABLE_POSIX_FS
|
||||||
|
#else
|
||||||
#define mkdir(a, b) mg_mkdir(a, b)
|
#define mkdir(a, b) mg_mkdir(a, b)
|
||||||
static inline int mg_mkdir(const char *path, mode_t mode) {
|
static inline int mg_mkdir(const char *path, mode_t mode) {
|
||||||
(void) path, (void) mode;
|
(void) path, (void) mode;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif // MG_ARCH == MG_ARCH_FREERTOS
|
#endif // MG_ARCH == MG_ARCH_FREERTOS
|
||||||
|
@ -254,6 +254,6 @@ void web_init(struct mg_mgr *mgr) {
|
|||||||
s_settings.device_name = strdup("My Device");
|
s_settings.device_name = strdup("My Device");
|
||||||
mg_http_listen(mgr, HTTP_URL, fn, NULL);
|
mg_http_listen(mgr, HTTP_URL, fn, NULL);
|
||||||
mg_http_listen(mgr, HTTPS_URL, fn, NULL);
|
mg_http_listen(mgr, HTTPS_URL, fn, NULL);
|
||||||
mg_timer_add(mgr, 3600 * 1000, MG_TIMER_RUN_NOW | MG_TIMER_REPEAT,
|
mg_timer_add(mgr, 10 * 1000, MG_TIMER_RUN_NOW | MG_TIMER_REPEAT,
|
||||||
timer_sntp_fn, mgr);
|
timer_sntp_fn, mgr);
|
||||||
}
|
}
|
||||||
|
@ -112,7 +112,7 @@ int main(int argc, char *argv[]) {
|
|||||||
struct mg_tcpip_driver driver = {.tx = tap_tx, .poll = tap_poll, .rx = tap_rx};
|
struct mg_tcpip_driver driver = {.tx = tap_tx, .poll = tap_poll, .rx = tap_rx};
|
||||||
struct mg_tcpip_if mif = {.driver = &driver,
|
struct mg_tcpip_if mif = {.driver = &driver,
|
||||||
.driver_data = &fd,
|
.driver_data = &fd,
|
||||||
.enable_req_dns = true,
|
.enable_req_dns = false,
|
||||||
.enable_req_sntp = true,
|
.enable_req_sntp = true,
|
||||||
.fn = mif_fn};
|
.fn = mif_fn};
|
||||||
sscanf(mac, "%hhx:%hhx:%hhx:%hhx:%hhx:%hhx", &mif.mac[0], &mif.mac[1],
|
sscanf(mac, "%hhx:%hhx:%hhx:%hhx:%hhx:%hhx", &mif.mac[0], &mif.mac[1],
|
||||||
|
Loading…
Reference in New Issue
Block a user