void __vine_dp_op_handler(int fd, int events, void *user_data)
{
uint64_t v;
+
+ vine_event_loop_del_io_handler(fd);
if (read(fd, &v, sizeof(v)) == -1) {
VINE_LOGE("Read error(%d)", errno);
return;
}
g_dp_plugin_fn.process_event(fd, events);
- vine_event_loop_del_io_handler(fd);
}
static void __pollfd_cb(vine_data_path_pollfd_op_e op, int fd, int events)
static void _logger(int log_level, const char *log)
{
- if (log_file) {
- fprintf(log_file, "%s\n", log);
- return;
- }
-
struct timespec ts;
if(clock_gettime(CLOCK_REALTIME, &ts) == -1 )
return;
- printf("[%ld.%03ld][T%5u] ",
+ char stamp[58] = {0, };
+ snprintf(stamp, 57, "[%ld.%03ld][T%5u]",
ts.tv_sec, ts.tv_nsec / 1000000, (unsigned int)syscall(__NR_gettid));
+
+ if (log_file) {
+ fprintf(log_file, "%s %s\n", stamp, log);
+ return;
+ }
+ printf("%s ", stamp);
switch (log_level) {
case VINE_LOG_DEBUG:
printf("DEBUG: ");