evolution-data-server r10110 - trunk/camel/providers/local
- From: tobiasmue svn gnome org
- To: svn-commits-list gnome org
- Subject: evolution-data-server r10110 - trunk/camel/providers/local
- Date: Fri, 27 Feb 2009 20:05:15 +0000 (UTC)
Author: tobiasmue
Date: Fri Feb 27 20:05:15 2009
New Revision: 10110
URL: http://svn.gnome.org/viewvc/evolution-data-server?rev=10110&view=rev
Log:
2009-02-27 Tobias Mueller <tobiasmue svn gnome org>
** Fixes bug 573183
* camel-mbox-folder.c: (mbox_get_filename):
Use a gint64 for a format string with the macro PRId64.
Also, keep indentation in empty lines, e.g. add spaces.
Modified:
trunk/camel/providers/local/ChangeLog
trunk/camel/providers/local/camel-mbox-folder.c
Modified: trunk/camel/providers/local/camel-mbox-folder.c
==============================================================================
--- trunk/camel/providers/local/camel-mbox-folder.c (original)
+++ trunk/camel/providers/local/camel-mbox-folder.c Fri Feb 27 20:05:15 2009
@@ -5,8 +5,8 @@
*
* Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
*
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU Lesser General Public
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
* License as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
@@ -244,24 +244,24 @@
filter_from = (CamelMimeFilter *) camel_mime_filter_from_new();
camel_stream_filter_add((CamelStreamFilter *) filter_stream, filter_from);
camel_object_unref (filter_from);
-
+
if (camel_data_wrapper_write_to_stream ((CamelDataWrapper *) message, filter_stream) == -1 ||
camel_stream_write (filter_stream, "\n", 1) == -1 ||
camel_stream_flush (filter_stream) == -1)
goto fail_write;
-
+
/* filter stream ref's the output stream itself, so we need to unref it too */
camel_object_unref (filter_stream);
camel_object_unref (output_stream);
g_free(fromline);
-
+
/* now we 'fudge' the summary to tell it its uptodate, because its idea of uptodate has just changed */
/* the stat really shouldn't fail, we just wrote to it */
if (g_stat (lf->folder_path, &st) == 0) {
((CamelFolderSummary *) mbs)->time = st.st_mtime;
mbs->folder_size = st.st_size;
}
-
+
/* unlock as soon as we can */
camel_local_folder_unlock(lf);
@@ -283,30 +283,30 @@
camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
_("Cannot append message to mbox file: %s: %s"),
lf->folder_path, g_strerror (errno));
-
+
if (output_stream) {
/* reset the file to original size */
do {
retval = ftruncate (((CamelStreamFs *) output_stream)->fd, mbs->folder_size);
} while (retval == -1 && errno == EINTR);
-
+
camel_object_unref (output_stream);
}
-
+
if (filter_stream)
camel_object_unref (filter_stream);
-
+
g_free(fromline);
-
+
/* remove the summary info so we are not out-of-sync with the mbox */
camel_folder_summary_remove_uid (CAMEL_FOLDER_SUMMARY (mbs), camel_message_info_uid (mi));
-
+
/* and tell the summary it's up-to-date */
if (g_stat (lf->folder_path, &st) == 0) {
((CamelFolderSummary *) mbs)->time = st.st_mtime;
mbs->folder_size = st.st_size;
}
-
+
fail:
/* make sure we unlock the folder - before we start triggering events into appland */
camel_local_folder_unlock(lf);
@@ -318,7 +318,7 @@
}
}
-static char*
+static char*
mbox_get_filename (CamelFolder *folder, const char *uid, CamelException *ex)
{
CamelLocalFolder *lf = (CamelLocalFolder *)folder;
@@ -337,7 +337,7 @@
camel_local_folder_unlock(lf);
return NULL;
}
-
+
/* get the message summary info */
info = (CamelMboxMessageInfo *) camel_folder_summary_uid(folder->summary, uid);
@@ -357,7 +357,7 @@
camel_message_info_free((CamelMessageInfo *)info);
- filename = g_strdup_printf ("%s%s!%" PRId64, lf->folder_path, G_DIR_SEPARATOR_S, (long long) frompos);
+ filename = g_strdup_printf ("%s%s!%" PRId64, lf->folder_path, G_DIR_SEPARATOR_S, (gint64) frompos);
fail:
/* and unlock now we're finished with it */
@@ -388,7 +388,7 @@
camel_local_folder_unlock(lf);
return NULL;
}
-
+
retry:
/* get the message summary info */
info = (CamelMboxMessageInfo *) camel_folder_summary_uid(folder->summary, uid);
@@ -407,7 +407,7 @@
frompos = info->frompos;
camel_message_info_free((CamelMessageInfo *)info);
-
+
/* we use an fd instead of a normal stream here - the reason is subtle, camel_mime_part will cache
the whole message in memory if the stream is non-seekable (which it is when built from a parser
with no stream). This means we dont have to lock the mbox for the life of the message, but only
@@ -451,7 +451,7 @@
_("The folder appears to be irrecoverably corrupted."));
goto fail;
}
-
+
message = camel_mime_message_new();
if (camel_mime_part_construct_from_parser((CamelMimePart *)message, parser) == -1) {
camel_exception_setv(ex, errno==EINTR?CAMEL_EXCEPTION_USER_CANCEL:CAMEL_EXCEPTION_SYSTEM,
@@ -469,7 +469,7 @@
if (parser)
camel_object_unref((CamelObject *)parser);
-
+
/* use the opportunity to notify of changes (particularly if we had a rebuild) */
if (camel_folder_change_info_changed(lf->changes)) {
camel_object_trigger_event((CamelObject *)folder, "folder_changed", lf->changes);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]