This is merely a historical archive of years 2008-2021, before the migration to mailman3.
A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/OpenBSC@lists.osmocom.org/.
Peter Stuge peter at stuge.seAndreas Eversberg wrote: > +/* add sec,usec to tv */ > +static void tv_add(struct timeval *tv, int sec, int usec) > +{ > + > + if (usec < 0) > + usec += USEC_1S; Doesn't this also need to do sec--; ? > + tv->tv_sec += sec; > + tv->tv_usec += usec; > + if (tv->tv_usec >= USEC_1S) { > + tv->tv_sec++; > + tv->tv_usec -= USEC_1S; > + } > +} Consider changing the second if() to while(), so that the function works correctly also when adding several seconds using only the usec parameter. Very nice use of defines! They make for excellent readability. //Peter