+ if (t.tv_sec < 0 || t.tv_nsec >= 1000000000) {
+ if (abortstr) {
+ fprintf(stderr, "%s: malformed time %li.%09li\n",
+ abortstr,
+ (long)t.tv_sec, (long)t.tv_nsec);
+ abort();
+ } else {
+ struct timespec old = t;
+
+ if (t.tv_nsec >= 1000000000) {
+ t.tv_sec += t.tv_nsec / 1000000000;
+ t.tv_nsec %= 1000000000;
+ }
+ if (t.tv_sec < 0)
+ t.tv_sec = 0;
+
+ fprintf(stderr, "WARNING: malformed time"
+ " %li seconds %li ns converted to %li.%09li.\n",
+ (long)old.tv_sec, (long)old.tv_nsec,
+ (long)t.tv_sec, (long)t.tv_nsec);
+ }
+ }
+ return t;