mirror of
https://github.com/linux-msm/cdba.git
synced 2026-02-25 13:11:56 -08:00
status: use %lld to print time_t
Some build configurations are switching to 64-bit time_t, breaking
builds on 32-bit architectures. Always use %lld and perform an explicit
conversion to (long long int) in order to make the code compile on all
architectures.
../status.c: In function 'status_send_values':
../status.c:46:53: error: format '%ld' expects argument of type 'long int', but argument 4 has type '__time64_t' {aka 'long long int'} [-Werror=format=]
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
This commit is contained in:
3
status.c
3
status.c
@@ -43,7 +43,8 @@ void status_send_values(const char *id, struct status_value *values)
|
||||
|
||||
status_get_ts(&ts);
|
||||
|
||||
len = snprintf(buf, sizeof(buf), "{\"ts\":%ld.%03ld, \"%s\":{ ", ts.tv_sec, ts.tv_nsec / 1000000, id);
|
||||
len = snprintf(buf, sizeof(buf), "{\"ts\":%lld.%03ld, \"%s\":{ ",
|
||||
(long long int)ts.tv_sec, ts.tv_nsec / 1000000, id);
|
||||
|
||||
for (value = values; value->unit; value++) {
|
||||
if (value != values) {
|
||||
|
||||
Reference in New Issue
Block a user