changeset 9100:f144ef760714 HEAD

expire-tool --test: Log timestamps also in user-readable format.
author Timo Sirainen <tss@iki.fi>
date Sun, 31 May 2009 19:48:46 -0400
parents e77a5e5ffc9d
children 6fd725b94504
files src/plugins/expire/expire-tool.c
diffstat 1 files changed, 7 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/plugins/expire/expire-tool.c	Sun May 31 19:29:53 2009 -0400
+++ b/src/plugins/expire/expire-tool.c	Sun May 31 19:48:46 2009 -0400
@@ -224,7 +224,7 @@
 	struct dict_transaction_context *trans;
 	struct dict_iterate_context *iter;
 	struct expire_env *env;
-	time_t oldest;
+	time_t oldest, expire_time;
 	unsigned int expunge_secs, altmove_secs;
 	const char *auth_socket, *p, *key, *value;
 	const char *userp, *mailbox;
@@ -286,12 +286,13 @@
 			}
 			continue;
 		}
-		if (time(NULL) < (time_t)strtoul(value, NULL, 10)) {
+		expire_time = strtoul(value, NULL, 10);
+		if (time(NULL) < expire_time) {
 			/* this and the rest of the timestamps are in future,
 			   so stop processing */
 			if (testrun) {
 				i_info("%s: stop, expire time in future: %s",
-				       userp, value);
+				       userp, ctime(&expire_time));
 			}
 			break;
 		}
@@ -325,8 +326,9 @@
 			} else if (!testrun)
 				dict_set(trans, key, new_value);
 			else {
-				i_info("%s: timestamp %s -> %s",
-				       userp, value, new_value);
+				i_info("%s: timestamp %s (%s) -> %s (%s)",
+				       userp, value, ctime(&expire_time),
+				       new_value, ctime(&oldest));
 			}
 		}
 	}