adjust for OpenBSD
This commit is contained in:
parent
e02f3db173
commit
6891d32607
@ -1,15 +1,14 @@
|
|||||||
BUILD_DIR = build
|
BUILD_DIR = build
|
||||||
|
|
||||||
C_SOURCES = \
|
C_SOURCES = \
|
||||||
../cube/User/Src/sha256.c \
|
sha256.c \
|
||||||
sink20169.c \
|
sink20169.c \
|
||||||
logging.c
|
logging.c
|
||||||
|
|
||||||
|
|
||||||
C_INCLUDES = \
|
C_INCLUDES = \
|
||||||
-I. \
|
-I. \
|
||||||
-I../cube/User/Inc \
|
-I/usr/local/include/postgresql
|
||||||
-I/usr/include/postgresql
|
|
||||||
|
|
||||||
VERSION := $(shell git rev-parse --short=8 HEAD)
|
VERSION := $(shell git rev-parse --short=8 HEAD)
|
||||||
|
|
||||||
|
@ -388,7 +388,13 @@ int sendToDB(t_forwarderHandle *handle, const char *location, const char *device
|
|||||||
char stmt[256];
|
char stmt[256];
|
||||||
int res1 = snprintf(stmt, sizeof(stmt),
|
int res1 = snprintf(stmt, sizeof(stmt),
|
||||||
"INSERT INTO mainsfrequency (time, host, location, freq) "
|
"INSERT INTO mainsfrequency (time, host, location, freq) "
|
||||||
"VALUES(to_timestamp(%lu), '%s', '%s', %d.%03d)",
|
"VALUES(to_timestamp("
|
||||||
|
#ifdef OpenBSD
|
||||||
|
"%llu"
|
||||||
|
#else
|
||||||
|
"%lu"
|
||||||
|
#endif
|
||||||
|
"), '%s', '%s', %d.%03d)",
|
||||||
timestamp, deviceId, location,
|
timestamp, deviceId, location,
|
||||||
frequency_before_point, frequency_behind_point);
|
frequency_before_point, frequency_behind_point);
|
||||||
if (res1 > sizeof(stmt)) {
|
if (res1 > sizeof(stmt)) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user