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

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


details:   http://hg.dovecot.org/dovecot/rev/a4cd1f37d022
changeset: 5888:a4cd1f37d022
user:      Timo Sirainen <tss at iki.fi>
date:      Tue Jul 03 20:44:08 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 3f2eb1b9c555 -r a4cd1f37d022 src/lib-storage/index/maildir/maildir-util.c
--- a/src/lib-storage/index/maildir/maildir-util.c	Tue Jul 03 20:04:28 2007 +0300
+++ b/src/lib-storage/index/maildir/maildir-util.c	Tue Jul 03 20:44:08 2007 +0300
@@ -224,12 +224,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