2005-10-14 Ross Burton <ross@burtonini.com>
- * libebook-e-destination.c:
+ * libedata-book/e-book-backend-summary.c:
+ Fix writing race to avoid recalculating the index (#316955).
+
+2005-10-14 Ross Burton <ross@burtonini.com>
+
+ * libebook/e-destination.c:
Fix typo when writing escaped names.
2005-10-04 Sushma Rai <rsushma@novell.com>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
+#include <utime.h>
#include <errno.h>
#include <libedataserver/e-sexp.h>
EBookBackendSummary *summary = E_BOOK_BACKEND_SUMMARY (object);
if (summary->priv) {
+ if (summary->priv->fp)
+ fclose (summary->priv->fp);
if (summary->priv->dirty)
- g_warning ("Destroying dirty summary");
+ e_book_backend_summary_save (summary);
+ else
+ utime (summary->priv->summary_path, NULL);
if (summary->priv->flush_timeout) {
g_source_remove (summary->priv->flush_timeout);
summary->priv->flush_timeout = 0;
}
- if (summary->priv->fp)
- fclose (summary->priv->fp);
-
g_free (summary->priv->summary_path);
clear_items (summary);
g_ptr_array_free (summary->priv->items, TRUE);
load that */
char *new_filename = g_strconcat (summary->priv->summary_path, ".new", NULL);
if (stat (new_filename, &sb) == -1) {
- g_warning ("no summary present");
g_free (new_filename);
return FALSE;
}
summary->priv->num_items = header.num_items;
summary->priv->file_version = header.file_version;
- summary->priv->mtime = header.summary_mtime;
+ summary->priv->mtime = sb.st_mtime;
summary->priv->fp = fp;
return TRUE;
g_warning ("failed to flush summary file to disk");
return TRUE; /* try again after the next timeout */
}
-
- g_warning ("flushed summary to disk");
-
+
+ g_message ("Flushed summary to disk");
+
/* we only want this to execute once, so return FALSE and set
summary->flush_timeout to 0 */
summary->priv->flush_timeout = 0;