diff --git a/plugins/mqtt/command/read_write.c b/plugins/mqtt/command/read_write.c index 5e7d70a91..eaf930f48 100644 --- a/plugins/mqtt/command/read_write.c +++ b/plugins/mqtt/command/read_write.c @@ -23,14 +23,6 @@ #include "read_write.h" -// static uint64_t current_time() -// { -// struct timeval tv; -// gettimeofday(&tv, NULL); -// uint64_t ms = tv.tv_sec; -// return ms * 1000 + tv.tv_usec / 1000; -// } - int command_rw_read_once_request(neu_plugin_t *plugin, neu_json_mqtt_t *mqtt, neu_json_read_req_t *req) { diff --git a/src/adapter/adapter.c b/src/adapter/adapter.c index 5ff813c2d..e3f411b86 100644 --- a/src/adapter/adapter.c +++ b/src/adapter/adapter.c @@ -815,7 +815,7 @@ static int update_timestamp(void *usr_data) uint64_t timestamp = 0; gettimeofday(&tv, NULL); - timestamp = tv.tv_sec * 1000 + tv.tv_usec / 1000; + timestamp = (int64_t) tv.tv_sec * 1000 + (int64_t) tv.tv_usec / 1000; adapter->timestamp = timestamp; neu_plugin_to_plugin_common(adapter->plugin)->timestamp = timestamp; diff --git a/src/base/group.c b/src/base/group.c index 37bcb314b..019a03deb 100644 --- a/src/base/group.c +++ b/src/base/group.c @@ -256,7 +256,7 @@ static void update_timestamp(neu_group_t *group) gettimeofday(&tv, NULL); - group->timestamp = tv.tv_sec * 1000 * 1000 + tv.tv_usec; + group->timestamp = (int64_t) tv.tv_sec * 1000 * 1000 + (int64_t) tv.tv_usec; } static UT_array *to_array(tag_elem_t *tags) diff --git a/src/base/neu_plugin_common.c b/src/base/neu_plugin_common.c index 729cce528..69d95bbe8 100644 --- a/src/base/neu_plugin_common.c +++ b/src/base/neu_plugin_common.c @@ -32,7 +32,8 @@ void neu_plugin_common_init(neu_plugin_common_t *common) common->magic = NEU_PLUGIN_MAGIC_NUMBER; common->link_state = NEU_NODE_LINK_STATE_DISCONNECTED; common->tag_size = 0; - common->timestamp = time(NULL) * 1000; // don't need much precision at init + common->timestamp = time(NULL); + common->timestamp *= 1000; // don't need much precision at init } bool neu_plugin_common_check(neu_plugin_t *plugin) diff --git a/src/event/event_linux.c b/src/event/event_linux.c index b35256bb8..d1448d3ce 100644 --- a/src/event/event_linux.c +++ b/src/event/event_linux.c @@ -103,10 +103,7 @@ static void *event_loop(void *arg) assert(size != -1); nng_mtx_lock(data->ctx.timer->mtx); - epoll_ctl(epoll_fd, EPOLL_CTL_DEL, data->fd, NULL); ret = data->callback.timer(data->usr_data); - timerfd_settime(data->fd, 0, &data->ctx.timer->value, NULL); - epoll_ctl(epoll_fd, EPOLL_CTL_ADD, data->fd, &event); nng_mtx_unlock(data->ctx.timer->mtx); } break; diff --git a/version b/version index ecf00d901..1506473e2 100644 --- a/version +++ b/version @@ -1 +1 @@ -2.2.5 \ No newline at end of file +2.2.6 \ No newline at end of file