into the seconds field when it is bumping the value last returned by
gettimeofday.
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@1831
dc483132-0cff-0310-8789-
dd5450dbe970
/* failed, return errno */
return (krb5_error_code) errno;
}
- if ((tv.tv_sec == last_tv.tv_sec) && (tv.tv_usec == last_tv.tv_usec))
- tv.tv_usec = ++last_tv.tv_usec;
- else
+ if ((tv.tv_sec == last_tv.tv_sec) && (tv.tv_usec == last_tv.tv_usec)) {
+ if (++last_tv.tv_usec >= 1000000) {
+ last_tv.tv_usec = 0;
+ last_tv.tv_sec++;
+ }
+ tv = last_tv;
+ } else
last_tv = tv;
*seconds = tv.tv_sec;