+
+/****************************************************************************/
+/* misc */
+/****************************************************************************/
+
+/* Decrease a file's modification time by 1 second */
+time_t m_decrease_mtime(const char *path, struct stat *st)
+{
+ struct utimbuf utim;
+ struct stat _st;
+ time_t mtime;
+
+ if (!st) {
+ if (stat(path, &_st) == -1)
+ return -1;
+ st = &_st;
+ }
+
+ if ((mtime = st->st_mtime) == time(NULL)) {
+ mtime -= 1;
+ utim.actime = mtime;
+ utim.modtime = mtime;
+ utime(path, &utim);
+ }
+
+ return mtime;
+}
+