dovecot-1.0: Update tmp/ directory's atime+mtime with utime(NULL...

dovecot at dovecot.org dovecot at dovecot.org
Tue Jul 3 20:44:15 EEST 2007


details:   http://hg.dovecot.org/dovecot-1.0/rev/8f7e3311006f
changeset: 5334:8f7e3311006f
user:      Timo Sirainen <tss at iki.fi>
date:      Tue Jul 03 20:44:07 2007 +0300
description:
Update tmp/ directory's atime+mtime with utime(NULL) so it works even if
we're not the directory owner.

diffstat:

1 file changed, 1 insertion(+), 6 deletions(-)
src/lib-storage/index/maildir/maildir-util.c |    7 +------

diffs (17 lines):

diff -r 9eb11ba455e0 -r 8f7e3311006f src/lib-storage/index/maildir/maildir-util.c
--- a/src/lib-storage/index/maildir/maildir-util.c	Mon Jul 02 21:13:03 2007 +0300
+++ b/src/lib-storage/index/maildir/maildir-util.c	Tue Jul 03 20:44:07 2007 +0300
@@ -215,12 +215,7 @@ void maildir_tmp_cleanup(struct mail_sto
 #endif
 	else if (st.st_atime < ioloop_time) {
 		/* mounted with noatime. update it ourself. */
-		struct utimbuf ut;
-
-		ut.actime = ioloop_time;
-		ut.modtime = st.st_mtime;
-
-		if (utime(dir, &ut) < 0 && errno != ENOENT) {
+		if (utime(dir, NULL) < 0 && errno != ENOENT) {
 			mail_storage_set_critical(storage,
 				"utime(%s) failed: %m", dir);
 		}


More information about the dovecot-cvs mailing list