mirror of
https://github.com/cesanta/mongoose.git
synced 2026-10-15 10:29:47 +00:00
Cleanup on riscv baremetal build
This commit is contained in:
1 parent
d6dbf831f7
commit
cddff2b1b8
4 files changed
+11
-15
No files matched your search
+3
-2
@@ -547,8 +547,9 @@ void mg_http_serve_file(struct mg_connection *c, struct mg_http_message *hm,
|
||||
"Content-Range: bytes " MG_INT64_FMT "-" MG_INT64_FMT
|
||||
"/" MG_INT64_FMT "\r\n",
|
||||
r1, r1 + cl - 1, (int64_t) st.st_size);
|
||||
#if _FILE_OFFSET_BITS == 64 || _POSIX_C_SOURCE >= 200112L || \
|
||||
_XOPEN_SOURCE >= 600
|
||||
#if defined(_FILE_OFFSET_BITS) && \
|
||||
(_FILE_OFFSET_BITS == 64 || _POSIX_C_SOURCE >= 200112L || \
|
||||
_XOPEN_SOURCE >= 600)
|
||||
fseeko(fp, (off_t) r1, SEEK_SET);
|
||||
#else
|
||||
fseek(fp, (long) r1, SEEK_SET);
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
#include "log.h"
|
||||
#include "util.h"
|
||||
|
||||
#if MG_ENABLE_MGOS
|
||||
#else
|
||||
#if MG_ENABLE_LOG
|
||||
static void mg_log_stdout(const void *buf, size_t len, void *userdata) {
|
||||
(void) userdata;
|
||||
@@ -69,4 +67,3 @@ void mg_log_set_callback(void (*fn)(const void *, size_t, void *), void *fnd) {
|
||||
s_fn_param = fnd;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
+3
-3
@@ -1,11 +1,11 @@
|
||||
#include "sntp.h"
|
||||
#include "arch.h"
|
||||
#include "event.h"
|
||||
#include "log.h"
|
||||
#include "sntp.h"
|
||||
#include "util.h"
|
||||
|
||||
#define SNTP_INTERVAL_SEC (3600)
|
||||
#define SNTP_TIME_OFFSET 2208988800
|
||||
#define SNTP_TIME_OFFSET 2208988800UL
|
||||
|
||||
static unsigned long s_sntmp_next;
|
||||
|
||||
@@ -21,7 +21,7 @@ int mg_sntp_parse(const unsigned char *buf, size_t len, struct timeval *tv) {
|
||||
LOG(LL_ERROR, ("%s", "server sent a kiss of death"));
|
||||
} else {
|
||||
uint32_t *data = (uint32_t *) &buf[40];
|
||||
tv->tv_sec = mg_ntohl(data[0]) - SNTP_TIME_OFFSET;
|
||||
tv->tv_sec = (time_t)(mg_ntohl(data[0]) - SNTP_TIME_OFFSET);
|
||||
tv->tv_usec = (suseconds_t) mg_ntohl(data[1]);
|
||||
s_sntmp_next = (unsigned long) (tv->tv_sec + SNTP_INTERVAL_SEC);
|
||||
res = 0;
|
||||
|
||||
Reference in new issue
Block a user