+static void stab_mtimenow(struct stat *out) {
+ int r = clock_gettime(CLOCK_REALTIME, &out->st_mtim);
+ if (r) diee("(stage2) clock_gettime");
+ if (debugmode)
+ fprintf(stderr,"stab_mtimenow mtim %lu.%06lu\n",
+ (unsigned long)out->st_mtim.tv_sec,
+ (unsigned long)out->st_mtim.tv_nsec);
+}
+
+#else /* !defined(st_mtime) */
+
+static bool stab_isnewer(const struct stat *a, const struct stat *b) {
+ if (debugmode)
+ fprintf(stderr,"stab_isnewer mtime %lu %lu\n",
+ (unsigned long)a->st_mtime,
+ (unsigned long)b->st_mtime);
+ return a->st_mtime > b->st_mtime;
+}
+
+static void stab_mtimenow(struct stat *out) {
+ out->st_mtime = time(NULL);
+ if (out->st_mtime == (time_t)-1) diee("(stage2) time()");
+ if (debugmode)
+ fprintf(stderr,"stab_mtimenow mtime %lu\n",
+ (unsigned long)out->st_mtime);
+}
+
+#endif /* !defined(st_mtime) */
+