diff src/plugins/trash/trash-plugin.c @ 6280:eb7c9d8ece54 HEAD

mail_*() APIs changed to return int and return the actual data as pointer. Changed some code to do error handling a bit better.
author Timo Sirainen <tss@iki.fi>
date Sun, 12 Aug 2007 19:40:54 +0300
parents f52e7d1402b5
children 8ebc07d2eee9
line wrap: on
line diff
--- a/src/plugins/trash/trash-plugin.c	Sun Aug 12 18:16:40 2007 +0300
+++ b/src/plugins/trash/trash-plugin.c	Sun Aug 12 19:40:54 2007 +0300
@@ -91,7 +91,8 @@
 		trash->mail_set = TRUE;
 	}
 
-	*received_time_r = mail_get_received_date(trash->mail);
+	if (mail_get_received_date(trash->mail, received_time_r) < 0)
+		return -1;
 	return 1;
 }
 
@@ -145,8 +146,8 @@
 		}
 
 		if (oldest_idx < count) {
-			size = mail_get_physical_size(trashes[oldest_idx].mail);
-			if (size == (uoff_t)-1) {
+			if (mail_get_physical_size(trashes[oldest_idx].mail,
+						   &size) < 0) {
 				/* maybe expunged already? */
 				trashes[oldest_idx].mail_set = FALSE;
 				continue;