Mitch Mitchell
Mitch Mitchell
looks like it should actually be: struct timeval now; time ( &now.tv_sec ); struct tm *t = gmtime(&now.tv_sec); and the lines struct timeval now; time ( &now.tv_sec ); need to...
I have successfully compiled by adding: struct timeval now; gettimeofday(&now, NULL); I'll see whether the numbers look anywhere reasonable over the next few days.
I got myself a bit confused looking over the code, I'm still getting output of aprx-stat with the date of 1970-01-02 for some reason, but the printtime function in aprx-stat.c...
after some investigation I'm questioning the use of CLOCK_MONOTONIC in aprx.c -- this is stated as a "Clock that cannot be set and represents monotonic time since some unspecified starting...
Here you can see the result of experimenting with CLOCK_REALTIME -- it fixes the date display, but not sure that works for the statistics. The entries stamped with 1970-01-01 represent...
OK it looks like CLOCK_REALTIME does work: APRX.pid 6584 APRX.uptime 6239 APRX.mycall AE5HO-12 SNMP AE5HO-12 6539 60 0 0 7223 66 59 1min data 2016-04-12 01:57 AE5HO-12 1m 0 0...
Ok, things seem to be working now, how do you want to get the changes? Should I attach a patch file?
I went ahead and set up some patch files for this issue, should be attached as a zip file. [aprx-patches.zip](https://github.com/PhirePhly/aprx/files/225177/aprx-patches.zip)
any chance of getting these patches incorporated into the mainline code?
Ha, I thought there had to be some implication regarding MONOTONIC vs REALTIME. Unfortunately I could not find a way to convert a MONOTONIC time back to a date stamp.