Signed-off-by: John Crispin <blogic@openwrt.org>
* GNU General Public License for more details.
*/
* GNU General Public License for more details.
*/
+#include <linux/types.h>
+
#include <libubox/uloop.h>
#include <libubox/blobmsg_json.h>
#include <libubox/uloop.h>
#include <libubox/blobmsg_json.h>
blobmsg_add_u32(&b, "id", l->id);
blobmsg_add_u32(&b, "priority", l->priority);
blobmsg_add_u32(&b, "source", l->source);
blobmsg_add_u32(&b, "id", l->id);
blobmsg_add_u32(&b, "priority", l->priority);
blobmsg_add_u32(&b, "source", l->source);
- blobmsg_add_u64(&b, "time", (l->ts.tv_sec * 1000) + (l->ts.tv_nsec / 1000000));
+ blobmsg_add_u64(&b, "time", l->ts.tv_sec);
blobmsg_close_table(&b, entry);
l = log_list(count, l);
}
blobmsg_close_table(&b, entry);
l = log_list(count, l);
}
blobmsg_add_u32(&b, "id", l->id);
blobmsg_add_u32(&b, "priority", l->priority);
blobmsg_add_u32(&b, "source", l->source);
blobmsg_add_u32(&b, "id", l->id);
blobmsg_add_u32(&b, "priority", l->priority);
blobmsg_add_u32(&b, "source", l->source);
- blobmsg_add_u64(&b, "time", (l->ts.tv_sec * 1000) + (l->ts.tv_nsec / 1000000));
+ blobmsg_add_u64(&b, "time", (((__u64) l->ts.tv_sec) * 1000) + (l->ts.tv_nsec / 1000000));
ret = ubus_notify(_ctx, &log_object, l->data, b.head, -1);
if (ret)
ret = ubus_notify(_ctx, &log_object, l->data, b.head, -1);
if (ret)
if (!tb[LOG_MSG] || !tb[LOG_ID] || !tb[LOG_PRIO] || !tb[LOG_SOURCE] || !tb[LOG_TIME])
continue;
if (!tb[LOG_MSG] || !tb[LOG_ID] || !tb[LOG_PRIO] || !tb[LOG_SOURCE] || !tb[LOG_TIME])
continue;
- t = blobmsg_get_u64(tb[LOG_TIME]) / 1000;
+ t = blobmsg_get_u64(tb[LOG_TIME]);
c = ctime(&t);
c[strlen(c) - 1] = '\0';
printf("%s - %s: %s\n",
c = ctime(&t);
c[strlen(c) - 1] = '\0';
printf("%s - %s: %s\n",