}
static void daylog_emit(void) {
- daylog_write("%s|%ld|%qu|%qu|%qu|%qu\n",
- fmt_date(today_real), (long)today_real,
+ daylog_write("%s|%qu|%qu|%qu|%qu|%qu\n",
+ fmt_date(today_real), (uint64_t)today_real,
bytes_in, bytes_out, pkts_in, pkts_out);
}
(long)today_real, (long)tomorrow_real);
bytes_in = bytes_out = pkts_in = pkts_out = 0;
- daylog_write("# logging started at %s (%ld)\n",
- fmt_date(today_real), (long)today_real);
+ daylog_write("# logging started at %s (%qu)\n",
+ fmt_date(today_real), (uint64_t)today_real);
}
void daylog_free(void) {
today_real = now_real();
daylog_emit(); /* Emit what's currently accumulated before we exit. */
- daylog_write("# logging stopped at %s (%ld)\n",
- fmt_date(today_real), (long)today_real);
+ daylog_write("# logging stopped at %s (%qu)\n",
+ fmt_date(today_real), (uint64_t)today_real);
}
void daylog_acct(uint64_t amount, enum graph_dir dir) {
g->pos = pos;
}
-static void graph_resync(const long new_time) {
+static void graph_resync(const time_t new_real) {
struct tm *tm;
/*
* If real time went backwards, we assume that the time adjustment should
* We rely on graph advancement to happen at the correct real time to
* account for, for example, bandwidth used per day.
*/
- assert(new_time < last_real);
+ assert(new_real < last_real);
- tm = localtime(&new_time);
+ tm = localtime(&new_real);
if (tm->tm_sec == 60)
tm->tm_sec = 59; /* mis-handle leap seconds */
rotate(&graph_hrs, tm->tm_hour);
rotate(&graph_days, tm->tm_mday - 1);
- last_real = new_time;
+ last_real = new_real;
}
void graph_rotate(void) {