return DLOG_ERROR_NONE;
char buf[LOG_MAX_PAYLOAD_SIZE];
- size_t len = vsnprintf(buf, sizeof buf, fmt, ap);
+ int len = vsnprintf(buf, sizeof buf, fmt, ap);
if (len < 0)
return DLOG_ERROR_NONE;
else if (len >= sizeof buf)
assert(!closed[2]);
logger.epoll_common.cnt = 1;
+ logger.epoll_socket.cnt = 1;
epoll_ctl_op_correct = EPOLL_CTL_DEL;
epoll_ctl_fd_correct = 3;
writer_close_fd(&logger, writer);
void call_time_span_test()
{
- /* the maximal size of time_t depends on architecture of system
- * and there is no TIME_T_MIN/MAX, so we need to calculate it */
- time_t max = get_time_t_max();
- time_t min = get_time_t_min();
-
time_span_test(5, 7, 2000);
time_span_test(7, 5, (unsigned long) -2000);
time_span_test(3, 3, 0);
time_span_test(6, 2, (unsigned long) -4000);
time_span_test(1, 20, 19000);
-/* TODO: ?
+#if 0 // some confusing results which rely on signed/unsigned shenanigans, not really worth enshrining in specification
+
+ /* the maximal size of time_t depends on architecture of system
+ * and there is no TIME_T_MIN/MAX, so we need to calculate it */
+ time_t max = get_time_t_max();
+ time_t min = get_time_t_min();
+
time_span_test(0, max/2 - 1, (unsigned long) -2000);
time_span_test(0, max/2 + 1, 0);
time_span_test(max, 2, 3000);
time_span_test(max, max - 1, (unsigned long) -1000);
time_span_test(min + 1 , max - 2, (unsigned long) -4000);
time_span_test(min, max, (unsigned long) -1000);
-*/
+#endif
}
int main()