aboutsummaryrefslogtreecommitdiffstats
path: root/camel/providers/local/camel-spool-summary.c
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2002-11-11 14:24:56 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2002-11-11 14:24:56 +0800
commit3eabd14ace6523781473486b533b8e4ac355fc14 (patch)
tree29d9174bec983d227fefa0d5e480ee8a7aff1509 /camel/providers/local/camel-spool-summary.c
parentd11a036199c97b083f531c03004f6ef20b38f843 (diff)
downloadgsoc2013-evolution-3eabd14ace6523781473486b533b8e4ac355fc14.tar
gsoc2013-evolution-3eabd14ace6523781473486b533b8e4ac355fc14.tar.gz
gsoc2013-evolution-3eabd14ace6523781473486b533b8e4ac355fc14.tar.bz2
gsoc2013-evolution-3eabd14ace6523781473486b533b8e4ac355fc14.tar.lz
gsoc2013-evolution-3eabd14ace6523781473486b533b8e4ac355fc14.tar.xz
gsoc2013-evolution-3eabd14ace6523781473486b533b8e4ac355fc14.tar.zst
gsoc2013-evolution-3eabd14ace6523781473486b533b8e4ac355fc14.zip
Use g_strerror when setting an exception string (we need it to be in
2002-11-11 Jeffrey Stedfast <fejj@ximian.com> * providers/local/camel-spool-summary.c (spool_summary_sync_full): Use g_strerror when setting an exception string (we need it to be in UTF-8). (spool_summary_check): Here too. * providers/local/camel-spool-store.c (construct): Use g_strerror when setting an exception string (we need it to be in UTF-8). (get_folder): Same. (scan_dir): Here too. * providers/local/camel-spool-folder.c (spool_lock): Use g_strerror when setting an exception string (we need it to be in UTF-8). * providers/local/camel-mh-summary.c (mh_summary_check): Use g_strerror when setting an exception string (we need it to be in UTF-8). * providers/local/camel-mh-store.c (delete_folder): Use g_strerror when setting an exception string (we need it to be in UTF-8). * providers/local/camel-mbox-summary.c (summary_update): Use g_strerror when setting an exception string (we need it to be in UTF-8). (mbox_summary_sync_full): Here too. (mbox_summary_sync_quick): Same. (mbox_summary_sync): Also here. (camel_mbox_summary_sync_mbox): Again here. * providers/local/camel-mbox-folder.c (mbox_lock): Use g_strerror when setting an exception string (we need it to be in UTF-8). (mbox_append_message): Same. (mbox_get_message): Here too. * providers/local/camel-maildir-summary.c (maildir_summary_load): Use g_strerror when setting an exception string (we need it to be in UTF-8). (maildir_summary_check): Same. * providers/local/camel-maildir-store.c (get_folder): Use g_strerror when setting an exception string (we need it to be in UTF-8). (delete_folder): Same. (delete_folder): Here too. * providers/local/camel-local-summary.c (local_summary_sync): Use g_strerror when setting an exception string (we need it to be in UTF-8). * providers/local/camel-local-store.c (get_folder): Use g_strerror when setting an exception string (we need it to be in UTF-8). (create_folder): Same. (xrename): Here too. (rename_folder): And here. (delete_folder): Also here. * camel-provider.c (camel_provider_init): For debugging printfs, we want to use normal strerror (we want locale charset, not UTF-8). * camel-movemail.c (camel_movemail): Use g_strerror when setting an exception string (we need it to be in UTF-8). (movemail_external): Same. (camel_movemail_copy_file): Here too. (camel_movemail_solaris): Also here. * camel-mime-utils.c (rfc2047_decode_word): For debugging printfs, we want to use normal strerror (we want locale charset, not UTF-8). (header_encode_param): Same. * camel-mime-part-utils.c (convert_buffer): For debugging printfs, we want to use normal strerror (we want locale charset, not UTF-8). * camel-lock-client.c (camel_lock_helper_init): Use g_strerror when setting an exception string (we need it to be in UTF-8). * camel-data-cache.c (camel_data_cache_remove): Use g_strerror when setting an exception string (we need it to be in UTF-8). * camel-tcp-stream-raw.c (flaky_tcp_write): For debugging printfs, we want to use normal strerror (we want locale charset, not UTF-8). (flaky_tcp_read): Same. * camel-gpg-context.c (gpg_ctx_op_step): For debugging printfs, we want to use normal strerror (we want locale charset, not UTF-8). * camel-service.c (camel_gethostbyname): Use g_strerror when setting an exception string (we need it to be in UTF-8). * camel-lock.c (camel_lock_dot): Use g_strerror when setting an exception string (we need it to be in UTF-8). (camel_lock_fcntl): Same. svn path=/trunk/; revision=18689
Diffstat (limited to 'camel/providers/local/camel-spool-summary.c')
-rw-r--r--camel/providers/local/camel-spool-summary.c81
1 files changed, 46 insertions, 35 deletions
diff --git a/camel/providers/local/camel-spool-summary.c b/camel/providers/local/camel-spool-summary.c
index 3a1a15cbc8..d71c75eaf8 100644
--- a/camel/providers/local/camel-spool-summary.c
+++ b/camel/providers/local/camel-spool-summary.c
@@ -146,9 +146,10 @@ spool_summary_sync_full(CamelMboxSummary *cls, gboolean expunge, CamelFolderChan
fd = open(((CamelLocalSummary *)cls)->folder_path, O_RDWR);
if (fd == -1) {
- camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM,
- _("Could not open file: %s: %s"),
- ((CamelLocalSummary *)cls)->folder_path, strerror(errno));
+ camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
+ _("Could not open file: %s: %s"),
+ ((CamelLocalSummary *)cls)->folder_path,
+ g_strerror (errno));
camel_operation_end(NULL);
return -1;
}
@@ -165,8 +166,9 @@ spool_summary_sync_full(CamelMboxSummary *cls, gboolean expunge, CamelFolderChan
#endif
d(printf("Writing tmp file to %s\n", tmpname));
if (fdout == -1) {
- camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM,
- _("Cannot open temporary mailbox: %s"), strerror(errno));
+ camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
+ _("Cannot open temporary mailbox: %s"),
+ g_strerror (errno));
goto error;
}
@@ -176,28 +178,31 @@ spool_summary_sync_full(CamelMboxSummary *cls, gboolean expunge, CamelFolderChan
/* sync out content */
if (fsync(fdout) == -1) {
- g_warning("Cannot sync temporary folder: %s", strerror(errno));
- camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM,
- _("Could not sync temporary folder %s: %s"),
- ((CamelLocalSummary *)cls)->folder_path, strerror(errno));
+ g_warning("Cannot sync temporary folder: %s", strerror (errno));
+ camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
+ _("Could not sync temporary folder %s: %s"),
+ ((CamelLocalSummary *)cls)->folder_path,
+ g_strerror (errno));
goto error;
}
/* see if we can write this much to the spool file */
if (fstat(fd, &st) == -1) {
- g_warning("Cannot sync temporary folder: %s", strerror(errno));
- camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM,
- _("Could not sync temporary folder %s: %s"),
- ((CamelLocalSummary *)cls)->folder_path, strerror(errno));
+ g_warning("Cannot sync temporary folder: %s", strerror (errno));
+ camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
+ _("Could not sync temporary folder %s: %s"),
+ ((CamelLocalSummary *)cls)->folder_path,
+ g_strerror (errno));
goto error;
}
spoollen = st.st_size;
if (fstat(fdout, &st) == -1) {
- g_warning("Cannot sync temporary folder: %s", strerror(errno));
- camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM,
- _("Could not sync temporary folder %s: %s"),
- ((CamelLocalSummary *)cls)->folder_path, strerror(errno));
+ g_warning("Cannot sync temporary folder: %s", strerror (errno));
+ camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
+ _("Could not sync temporary folder %s: %s"),
+ ((CamelLocalSummary *)cls)->folder_path,
+ g_strerror (errno));
goto error;
}
outlen = st.st_size;
@@ -209,10 +214,11 @@ spool_summary_sync_full(CamelMboxSummary *cls, gboolean expunge, CamelFolderChan
|| fsync(fd) == -1
|| lseek(fd, 0, SEEK_SET) == -1
|| lseek(fdout, 0, SEEK_SET) == -1)) {
- g_warning("Cannot sync spool folder: %s", strerror(errno));
- camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM,
- _("Could not sync spool folder %s: %s"),
- ((CamelLocalSummary *)cls)->folder_path, strerror(errno));
+ g_warning("Cannot sync spool folder: %s", strerror (errno));
+ camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
+ _("Could not sync spool folder %s: %s"),
+ ((CamelLocalSummary *)cls)->folder_path,
+ g_strerror (errno));
/* incase we ran out of room, remove any trailing space first */
ftruncate(fd, spoollen);
goto error;
@@ -240,10 +246,11 @@ spool_summary_sync_full(CamelMboxSummary *cls, gboolean expunge, CamelFolderChan
}
if (size == -1) {
- camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM,
- _("Could not sync spool folder %s: %s\n"
- "Folder may be corrupt, copy saved in `%s'"),
- ((CamelLocalSummary *)cls)->folder_path, strerror(errno), tmpnam);
+ camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
+ _("Could not sync spool folder %s: %s\n"
+ "Folder may be corrupt, copy saved in `%s'"),
+ ((CamelLocalSummary *)cls)->folder_path,
+ g_strerror (errno), tmpnam);
/* so we dont delete it */
close(fdout);
tmpname = NULL;
@@ -258,10 +265,11 @@ spool_summary_sync_full(CamelMboxSummary *cls, gboolean expunge, CamelFolderChan
d(printf("Closing folders\n"));
if (ftruncate(fd, outlen) == -1) {
- camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM,
- _("Could not sync spool folder %s: %s\n"
- "Folder may be corrupt, copy saved in `%s'"),
- ((CamelLocalSummary *)cls)->folder_path, strerror(errno), tmpnam);
+ camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
+ _("Could not sync spool folder %s: %s\n"
+ "Folder may be corrupt, copy saved in `%s'"),
+ ((CamelLocalSummary *)cls)->folder_path,
+ g_strerror (errno), tmpnam);
close(fdout);
tmpname = NULL;
fdout = -1;
@@ -269,11 +277,12 @@ spool_summary_sync_full(CamelMboxSummary *cls, gboolean expunge, CamelFolderChan
}
if (close(fd) == -1) {
- g_warning("Cannot close source folder: %s", strerror(errno));
- camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM,
- _("Could not sync spool folder %s: %s\n"
- "Folder may be corrupt, copy saved in `%s'"),
- ((CamelLocalSummary *)cls)->folder_path, strerror(errno), tmpnam);
+ g_warning("Cannot close source folder: %s", strerror (errno));
+ camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
+ _("Could not sync spool folder %s: %s\n"
+ "Folder may be corrupt, copy saved in `%s'"),
+ ((CamelLocalSummary *)cls)->folder_path,
+ g_strerror (errno), tmpnam);
close(fdout);
tmpname = NULL;
fdout = -1;
@@ -329,7 +338,9 @@ spool_summary_check(CamelLocalSummary *cls, CamelFolderChangeInfo *changeinfo, C
return -1;
if (stat(cls->folder_path, &st) == -1) {
- camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM, _("Unknown error: %s"), strerror(errno));
+ camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
+ _("Unknown error: %s"),
+ g_strerror (errno));
return -1;
}