aboutsummaryrefslogtreecommitdiffstats
path: root/camel/providers
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
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')
-rw-r--r--camel/providers/local/camel-local-folder.c2
-rw-r--r--camel/providers/local/camel-local-store.c44
-rw-r--r--camel/providers/local/camel-local-summary.c10
-rw-r--r--camel/providers/local/camel-maildir-folder.c5
-rw-r--r--camel/providers/local/camel-maildir-store.c35
-rw-r--r--camel/providers/local/camel-maildir-summary.c10
-rw-r--r--camel/providers/local/camel-mbox-folder.c14
-rw-r--r--camel/providers/local/camel-mbox-store.c18
-rw-r--r--camel/providers/local/camel-mbox-summary.c87
-rw-r--r--camel/providers/local/camel-mh-folder.c10
-rw-r--r--camel/providers/local/camel-mh-store.c10
-rw-r--r--camel/providers/local/camel-mh-summary.c8
-rw-r--r--camel/providers/local/camel-spool-folder.c4
-rw-r--r--camel/providers/local/camel-spool-store.c37
-rw-r--r--camel/providers/local/camel-spool-summary.c81
15 files changed, 207 insertions, 168 deletions
diff --git a/camel/providers/local/camel-local-folder.c b/camel/providers/local/camel-local-folder.c
index 3271288389..8fd0a23e2f 100644
--- a/camel/providers/local/camel-local-folder.c
+++ b/camel/providers/local/camel-local-folder.c
@@ -253,7 +253,7 @@ camel_local_folder_construct(CamelLocalFolder *lf, CamelStore *parent_store, con
lf->index = (CamelIndex *)camel_text_index_new(lf->index_path, flag);
if (lf->index == NULL) {
/* yes, this isn't fatal at all */
- g_warning("Could not open/create index file: %s: indexing not performed", strerror(errno));
+ g_warning("Could not open/create index file: %s: indexing not performed", strerror (errno));
forceindex = FALSE;
/* record that we dont have an index afterall */
flags &= ~CAMEL_STORE_FOLDER_BODY_INDEX;
diff --git a/camel/providers/local/camel-local-store.c b/camel/providers/local/camel-local-store.c
index 7a9cd86de1..b325df769a 100644
--- a/camel/providers/local/camel-local-store.c
+++ b/camel/providers/local/camel-local-store.c
@@ -151,8 +151,9 @@ get_folder(CamelStore * store, const char *folder_name, guint32 flags, CamelExce
if (errno != ENOENT
|| (flags & CAMEL_STORE_FOLDER_CREATE) == 0) {
- camel_exception_setv(ex, CAMEL_EXCEPTION_STORE_NO_FOLDER,
- _("Cannot get folder: %s: %s"), path, strerror(errno));
+ camel_exception_setv (ex, CAMEL_EXCEPTION_STORE_NO_FOLDER,
+ _("Cannot get folder: %s: %s"),
+ path, g_strerror (errno));
return NULL;
}
@@ -164,11 +165,11 @@ get_folder(CamelStore * store, const char *folder_name, guint32 flags, CamelExce
slash = strchr(slash+1, '/');
if (slash)
*slash = 0;
- if (stat(sub, &st) == -1) {
- if (errno != ENOENT
- || mkdir(sub, 0700) == -1) {
- camel_exception_setv(ex, CAMEL_EXCEPTION_STORE_NO_FOLDER,
- _("Cannot get folder: %s: %s"), path, strerror(errno));
+ if (stat (sub, &st) == -1) {
+ if (errno != ENOENT || mkdir (sub, 0700) == -1) {
+ camel_exception_setv (ex, CAMEL_EXCEPTION_STORE_NO_FOLDER,
+ _("Cannot get folder: %s: %s"),
+ path, g_strerror (errno));
return NULL;
}
}
@@ -234,8 +235,9 @@ create_folder(CamelStore *store, const char *parent_name, const char *folder_nam
name = g_strdup_printf("%s/%s", path, folder_name);
if (stat(name, &st) == 0 || errno != ENOENT) {
- camel_exception_setv(ex, CAMEL_EXCEPTION_STORE_NO_FOLDER,
- _("Cannot get folder: %s: %s"), name, strerror(errno));
+ camel_exception_setv (ex, CAMEL_EXCEPTION_STORE_NO_FOLDER,
+ _("Cannot get folder: %s: %s"),
+ name, g_strerror (errno));
g_free(name);
return NULL;
}
@@ -302,9 +304,9 @@ static int xrename(const char *oldp, const char *newp, const char *prefix, const
}
if (ret == -1) {
- camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM,
- _("Could not rename folder %s to %s: %s"),
- old, new, strerror(err));
+ camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
+ _("Could not rename folder %s to %s: %s"),
+ old, new, g_strerror (err));
}
g_free(old);
@@ -359,9 +361,9 @@ summary_failed:
} else
camel_text_index_rename(newibex, oldibex);
ibex_failed:
- camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM,
- _("Could not rename '%s': %s"),
- old, strerror(errno));
+ camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
+ _("Could not rename '%s': %s"),
+ old, g_strerror (errno));
CAMEL_STORE_UNLOCK(store, cache_lock);
g_free(newibex);
@@ -380,9 +382,9 @@ delete_folder(CamelStore *store, const char *folder_name, CamelException *ex)
name = g_strdup_printf("%s%s", CAMEL_LOCAL_STORE(store)->toplevel_dir, folder_name);
str = g_strdup_printf("%s.ev-summary", name);
if (unlink(str) == -1 && errno != ENOENT) {
- camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM,
- _("Could not delete folder summary file `%s': %s"),
- str, strerror(errno));
+ camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
+ _("Could not delete folder summary file `%s': %s"),
+ str, g_strerror (errno));
g_free(str);
g_free (name);
return;
@@ -390,9 +392,9 @@ delete_folder(CamelStore *store, const char *folder_name, CamelException *ex)
g_free(str);
str = g_strdup_printf("%s.ibex", name);
if (camel_text_index_remove(str) == -1 && errno != ENOENT) {
- camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM,
- _("Could not delete folder index file `%s': %s"),
- str, strerror(errno));
+ camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
+ _("Could not delete folder index file `%s': %s"),
+ str, g_strerror (errno));
g_free(str);
g_free (name);
return;
diff --git a/camel/providers/local/camel-local-summary.c b/camel/providers/local/camel-local-summary.c
index 18c0b80ce5..4e83224cfe 100644
--- a/camel/providers/local/camel-local-summary.c
+++ b/camel/providers/local/camel-local-summary.c
@@ -394,13 +394,15 @@ local_summary_sync(CamelLocalSummary *cls, gboolean expunge, CamelFolderChangeIn
ret = camel_folder_summary_save((CamelFolderSummary *)cls);
if (ret == -1) {
- camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM,
- _("Could not save summary: %s: %s"), cls->folder_path, strerror(errno));
- g_warning("Could not save summary for %s: %s", cls->folder_path, strerror(errno));
+ camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
+ _("Could not save summary: %s: %s"),
+ cls->folder_path, g_strerror (errno));
+
+ g_warning ("Could not save summary for %s: %s", cls->folder_path, strerror (errno));
}
if (cls->index && camel_index_sync(cls->index) == -1)
- g_warning("Could not sync index for %s: %s", cls->folder_path, strerror(errno));
+ g_warning ("Could not sync index for %s: %s", cls->folder_path, strerror (errno));
return ret;
}
diff --git a/camel/providers/local/camel-maildir-folder.c b/camel/providers/local/camel-maildir-folder.c
index 05fdd70e10..d3cbc490b5 100644
--- a/camel/providers/local/camel-maildir-folder.c
+++ b/camel/providers/local/camel-maildir-folder.c
@@ -221,8 +221,9 @@ static CamelMimeMessage *maildir_get_message(CamelFolder * folder, const gchar *
camel_folder_summary_info_free(folder->summary, info);
if ((message_stream = camel_stream_fs_new_with_name(name, O_RDONLY, 0)) == NULL) {
- camel_exception_setv(ex, CAMEL_EXCEPTION_FOLDER_INVALID_UID, _("Cannot get message: %s\n %s"),
- name, g_strerror(errno));
+ camel_exception_setv (ex, CAMEL_EXCEPTION_FOLDER_INVALID_UID,
+ _("Cannot get message: %s\n %s"),
+ name, g_strerror (errno));
g_free(name);
return NULL;
}
diff --git a/camel/providers/local/camel-maildir-store.c b/camel/providers/local/camel-maildir-store.c
index 53d554d16a..8e6cc1ee9d 100644
--- a/camel/providers/local/camel-maildir-store.c
+++ b/camel/providers/local/camel-maildir-store.c
@@ -102,20 +102,20 @@ get_folder(CamelStore * store, const char *folder_name, guint32 flags, CamelExce
if (stat(name, &st) == -1) {
if (errno != ENOENT) {
- camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM,
- _("Could not open folder `%s':\n%s"),
- folder_name, strerror(errno));
+ camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
+ _("Could not open folder `%s':\n%s"),
+ folder_name, g_strerror (errno));
} else if ((flags & CAMEL_STORE_FOLDER_CREATE) == 0) {
- camel_exception_setv(ex, CAMEL_EXCEPTION_STORE_NO_FOLDER,
- _("Folder `%s' does not exist."), folder_name);
+ camel_exception_setv (ex, CAMEL_EXCEPTION_STORE_NO_FOLDER,
+ _("Folder `%s' does not exist."), folder_name);
} else {
if (mkdir(name, 0700) != 0
|| mkdir(tmp, 0700) != 0
|| mkdir(cur, 0700) != 0
|| mkdir(new, 0700) != 0) {
- camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM,
- _("Could not create folder `%s':\n%s"),
- folder_name, strerror(errno));
+ camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
+ _("Could not create folder `%s':\n%s"),
+ folder_name, g_strerror (errno));
rmdir(tmp);
rmdir(cur);
rmdir(new);
@@ -163,9 +163,10 @@ static void delete_folder(CamelStore * store, const char *folder_name, CamelExce
|| stat(tmp, &st) == -1 || !S_ISDIR(st.st_mode)
|| stat(cur, &st) == -1 || !S_ISDIR(st.st_mode)
|| stat(new, &st) == -1 || !S_ISDIR(st.st_mode)) {
- camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM,
- _("Could not delete folder `%s': %s"),
- folder_name, errno?strerror(errno):_("not a maildir directory"));
+ camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
+ _("Could not delete folder `%s': %s"),
+ folder_name, errno ? g_strerror (errno) :
+ _("not a maildir directory"));
} else {
int err = 0;
@@ -200,9 +201,9 @@ static void delete_folder(CamelStore * store, const char *folder_name, CamelExce
mkdir(cur, 0700);
mkdir(new, 0700);
mkdir(tmp, 0700);
- camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM,
- _("Could not delete folder `%s': %s"),
- folder_name, strerror(err));
+ camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
+ _("Could not delete folder `%s': %s"),
+ folder_name, g_strerror (err));
} else {
/* and remove metadata */
((CamelStoreClass *)parent_class)->delete_folder(store, folder_name, ex);
@@ -331,9 +332,9 @@ static int scan_dir(CamelStore *store, GHashTable *visited, char *root, const ch
if (((flags & CAMEL_STORE_FOLDER_INFO_RECURSIVE) || parent == NULL)) {
dir = opendir(name);
if (dir == NULL) {
- camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM,
- _("Could not scan folder `%s': %s"),
- root, strerror(errno));
+ camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
+ _("Could not scan folder `%s': %s"),
+ root, g_strerror (errno));
g_free(name);
return -1;
}
diff --git a/camel/providers/local/camel-maildir-summary.c b/camel/providers/local/camel-maildir-summary.c
index ae3b81438b..ea3c1b8dbf 100644
--- a/camel/providers/local/camel-maildir-summary.c
+++ b/camel/providers/local/camel-maildir-summary.c
@@ -413,7 +413,9 @@ static int maildir_summary_load(CamelLocalSummary *cls, int forceindex, CamelExc
dir = opendir(cur);
if (dir == NULL) {
- camel_exception_setv(ex, 1, _("Cannot open maildir directory path: %s: %s"), cls->folder_path, strerror(errno));
+ camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
+ _("Cannot open maildir directory path: %s: %s"),
+ cls->folder_path, g_strerror (errno));
g_free(cur);
return -1;
}
@@ -461,7 +463,7 @@ static int camel_maildir_summary_add(CamelLocalSummary *cls, const char *name, i
fd = open(filename, O_RDONLY);
if (fd == -1) {
- g_warning("Cannot summarise/index: %s: %s", filename, strerror(errno));
+ g_warning ("Cannot summarise/index: %s: %s", filename, strerror (errno));
g_free(filename);
return -1;
}
@@ -542,7 +544,9 @@ maildir_summary_check(CamelLocalSummary *cls, CamelFolderChangeInfo *changes, Ca
no longer exist */
dir = opendir(cur);
if (dir == NULL) {
- camel_exception_setv(ex, 1, _("Cannot open maildir directory path: %s: %s"), cls->folder_path, strerror(errno));
+ camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
+ _("Cannot open maildir directory path: %s: %s"),
+ cls->folder_path, g_strerror (errno));
g_free(cur);
g_free(new);
camel_operation_end(NULL);
diff --git a/camel/providers/local/camel-mbox-folder.c b/camel/providers/local/camel-mbox-folder.c
index 8d1fdfd543..e06a63fe47 100644
--- a/camel/providers/local/camel-mbox-folder.c
+++ b/camel/providers/local/camel-mbox-folder.c
@@ -155,7 +155,9 @@ static int mbox_lock(CamelLocalFolder *lf, CamelLockType type, CamelException *e
mf->lockfd = open(lf->folder_path, O_RDWR, 0);
if (mf->lockfd == -1) {
- camel_exception_setv(ex, 1, _("Cannot create folder lock on %s: %s"), lf->folder_path, strerror(errno));
+ camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
+ _("Cannot create folder lock on %s: %s"),
+ lf->folder_path, g_strerror (errno));
return -1;
}
@@ -212,7 +214,9 @@ mbox_append_message(CamelFolder *folder, CamelMimeMessage * message, const Camel
output_stream = camel_stream_fs_new_with_name(lf->folder_path, O_WRONLY|O_APPEND, 0600);
if (output_stream == NULL) {
- camel_exception_setv(ex, 1, _("Cannot open mailbox: %s: %s\n"), lf->folder_path, strerror(errno));
+ camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
+ _("Cannot open mailbox: %s: %s\n"),
+ lf->folder_path, g_strerror (errno));
goto fail;
}
@@ -361,9 +365,9 @@ retry:
fd = open(lf->folder_path, O_RDONLY);
if (fd == -1) {
- camel_exception_setv(ex, CAMEL_EXCEPTION_FOLDER_INVALID_UID,
- _("Cannot get message: %s from folder %s\n %s"), uid, lf->folder_path,
- strerror(errno));
+ camel_exception_setv (ex, CAMEL_EXCEPTION_FOLDER_INVALID_UID,
+ _("Cannot get message: %s from folder %s\n %s"),
+ uid, lf->folder_path, g_strerror (errno));
goto fail;
}
diff --git a/camel/providers/local/camel-mbox-store.c b/camel/providers/local/camel-mbox-store.c
index cfe3429713..9bf6737372 100644
--- a/camel/providers/local/camel-mbox-store.c
+++ b/camel/providers/local/camel-mbox-store.c
@@ -90,25 +90,25 @@ get_folder(CamelStore *store, const char *folder_name, guint32 flags, CamelExcep
int fd;
if (errno != ENOENT) {
- camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM,
- _("Could not open file `%s':\n%s"),
- name, g_strerror(errno));
+ camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
+ _("Could not open file `%s':\n%s"),
+ name, g_strerror (errno));
g_free(name);
return NULL;
}
if ((flags & CAMEL_STORE_FOLDER_CREATE) == 0) {
- camel_exception_setv(ex, CAMEL_EXCEPTION_STORE_NO_FOLDER,
- _("Folder `%s' does not exist."),
- folder_name);
+ camel_exception_setv (ex, CAMEL_EXCEPTION_STORE_NO_FOLDER,
+ _("Folder `%s' does not exist."),
+ folder_name);
g_free(name);
return NULL;
}
fd = open(name, O_WRONLY | O_CREAT | O_APPEND, 0600);
if (fd == -1) {
- camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM,
- _("Could not create file `%s':\n%s"),
- name, g_strerror(errno));
+ camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
+ _("Could not create file `%s':\n%s"),
+ name, g_strerror (errno));
g_free(name);
return NULL;
}
diff --git a/camel/providers/local/camel-mbox-summary.c b/camel/providers/local/camel-mbox-summary.c
index 564914aa59..5b001c0977 100644
--- a/camel/providers/local/camel-mbox-summary.c
+++ b/camel/providers/local/camel-mbox-summary.c
@@ -346,9 +346,10 @@ summary_update(CamelLocalSummary *cls, off_t offset, CamelFolderChangeInfo *chan
fd = open(cls->folder_path, O_RDONLY);
if (fd == -1) {
- d(printf("%s failed to open: %s\n", cls->folder_path, strerror(errno)));
- camel_exception_setv(ex, 1, _("Could not open folder: %s: %s"),
- cls->folder_path, strerror(errno));
+ d(printf("%s failed to open: %s\n", cls->folder_path, strerror (errno)));
+ camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
+ _("Could not open folder: %s: %s"),
+ cls->folder_path, g_strerror (errno));
camel_operation_end(NULL);
return -1;
}
@@ -450,7 +451,9 @@ mbox_summary_check(CamelLocalSummary *cls, CamelFolderChangeInfo *changes, Camel
/* check if the summary is up-to-date */
if (stat(cls->folder_path, &st) == -1) {
camel_folder_summary_clear(s);
- camel_exception_setv(ex, 1, _("Cannot check folder: %s: %s"), cls->folder_path, strerror(errno));
+ camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
+ _("Cannot check folder: %s: %s"),
+ cls->folder_path, g_strerror (errno));
return -1;
}
@@ -584,9 +587,9 @@ mbox_summary_sync_full(CamelMboxSummary *mbs, gboolean expunge, CamelFolderChang
fd = open(cls->folder_path, O_RDONLY);
if (fd == -1) {
- camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM,
- _("Could not open file: %s: %s"),
- cls->folder_path, strerror(errno));
+ camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
+ _("Could not open file: %s: %s"),
+ cls->folder_path, g_strerror (errno));
camel_operation_end(NULL);
return -1;
}
@@ -596,8 +599,9 @@ mbox_summary_sync_full(CamelMboxSummary *mbs, gboolean expunge, CamelFolderChang
d(printf("Writing tmp file to %s\n", tmpname));
fdout = open(tmpname, O_WRONLY|O_CREAT|O_TRUNC, 0600);
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;
}
@@ -607,19 +611,19 @@ mbox_summary_sync_full(CamelMboxSummary *mbs, gboolean expunge, CamelFolderChang
d(printf("Closing folders\n"));
if (close(fd) == -1) {
- g_warning("Cannot close source folder: %s", strerror(errno));
- camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM,
- _("Could not close source folder %s: %s"),
- cls->folder_path, strerror(errno));
+ g_warning("Cannot close source folder: %s", strerror (errno));
+ camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
+ _("Could not close source folder %s: %s"),
+ cls->folder_path, g_strerror (errno));
fd = -1;
goto error;
}
if (close(fdout) == -1) {
- g_warning("Cannot close tmp folder: %s", strerror(errno));
- camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM,
- _("Could not close temp folder: %s"),
- strerror(errno));
+ g_warning("Cannot close tmp folder: %s", strerror (errno));
+ camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
+ _("Could not close temp folder: %s"),
+ g_strerror (errno));
fdout = -1;
goto error;
}
@@ -627,10 +631,10 @@ mbox_summary_sync_full(CamelMboxSummary *mbs, gboolean expunge, CamelFolderChang
/* this should probably either use unlink/link/unlink, or recopy over
the original mailbox, for various locking reasons/etc */
if (rename(tmpname, cls->folder_path) == -1) {
- g_warning("Cannot rename folder: %s", strerror(errno));
- camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM,
- _("Could not rename folder: %s"),
- strerror(errno));
+ g_warning("Cannot rename folder: %s", strerror (errno));
+ camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
+ _("Could not rename folder: %s"),
+ g_strerror (errno));
goto error;
}
tmpname = NULL;
@@ -674,9 +678,9 @@ mbox_summary_sync_quick(CamelMboxSummary *mbs, gboolean expunge, CamelFolderChan
fd = open(cls->folder_path, O_RDWR);
if (fd == -1) {
- camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM,
- _("Could not open file: %s: %s"),
- cls->folder_path, strerror(errno));
+ camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
+ _("Could not open file: %s: %s"),
+ cls->folder_path, g_strerror (errno));
camel_operation_end(NULL);
return -1;
@@ -769,10 +773,10 @@ mbox_summary_sync_quick(CamelMboxSummary *mbs, gboolean expunge, CamelFolderChan
d(printf("Closing folders\n"));
if (close(fd) == -1) {
- g_warning("Cannot close source folder: %s", strerror(errno));
- camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM,
- _("Could not close source folder %s: %s"),
- cls->folder_path, strerror(errno));
+ g_warning ("Cannot close source folder: %s", strerror (errno));
+ camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
+ _("Could not close source folder %s: %s"),
+ cls->folder_path, g_strerror (errno));
fd = -1;
goto error;
}
@@ -845,7 +849,8 @@ mbox_summary_sync(CamelLocalSummary *cls, gboolean expunge, CamelFolderChangeInf
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;
}
@@ -879,8 +884,9 @@ camel_mbox_summary_sync_mbox(CamelMboxSummary *cls, guint32 flags, CamelFolderCh
/* need to dup this because the mime-parser owns the fd after we give it to it */
fd = dup(fd);
if (fd == -1) {
- camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM,
- _("Could not store folder: %s"), strerror(errno));
+ camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
+ _("Could not store folder: %s"),
+ g_strerror (errno));
return -1;
}
@@ -972,9 +978,9 @@ camel_mbox_summary_sync_mbox(CamelMboxSummary *cls, guint32 flags, CamelFolderCh
#endif
if (len == -1) {
d(printf("Error writing to tmp mailbox\n"));
- camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM,
- _("Error writing to temp mailbox: %s"),
- strerror(errno));
+ camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
+ _("Error writing to temp mailbox: %s"),
+ g_strerror (errno));
goto error;
}
info->info.flags &= 0xffff;
@@ -989,17 +995,18 @@ camel_mbox_summary_sync_mbox(CamelMboxSummary *cls, guint32 flags, CamelFolderCh
while (camel_mime_parser_step(mp, &buffer, &len) == HSCAN_PRE_FROM) {
/*d(printf("copying mbox contents to tmp: '%.*s'\n", len, buffer));*/
if (write(fdout, buffer, len) != len) {
- camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM,
- _("Writing to tmp mailbox failed: %s: %s"),
- ((CamelLocalSummary *)cls)->folder_path, strerror(errno));
+ camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
+ _("Writing to tmp mailbox failed: %s: %s"),
+ ((CamelLocalSummary *)cls)->folder_path,
+ g_strerror (errno));
goto error;
}
}
if (write(fdout, "\n", 1) != 1) {
- camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM,
- _("Error writing to temp mailbox: %s"),
- strerror(errno));
+ camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
+ _("Error writing to temp mailbox: %s"),
+ g_strerror (errno));
goto error;
}
diff --git a/camel/providers/local/camel-mh-folder.c b/camel/providers/local/camel-mh-folder.c
index 396435da0e..02d3370428 100644
--- a/camel/providers/local/camel-mh-folder.c
+++ b/camel/providers/local/camel-mh-folder.c
@@ -207,16 +207,18 @@ static CamelMimeMessage *mh_get_message(CamelFolder * folder, const gchar * uid,
name = g_strdup_printf("%s/%s", lf->folder_path, uid);
if ((message_stream = camel_stream_fs_new_with_name(name, O_RDONLY, 0)) == NULL) {
- camel_exception_setv(ex, CAMEL_EXCEPTION_FOLDER_INVALID_UID, _("Cannot get message: %s\n %s"),
- name, g_strerror(errno));
+ camel_exception_setv (ex, CAMEL_EXCEPTION_FOLDER_INVALID_UID,
+ _("Cannot get message: %s\n %s"),
+ name, g_strerror (errno));
g_free(name);
return NULL;
}
message = camel_mime_message_new();
if (camel_data_wrapper_construct_from_stream((CamelDataWrapper *)message, message_stream) == -1) {
- camel_exception_setv(ex, CAMEL_EXCEPTION_FOLDER_INVALID_UID, _("Cannot get message: %s\n %s"),
- name, _("Invalid message contents"));
+ camel_exception_setv (ex, CAMEL_EXCEPTION_FOLDER_INVALID_UID,
+ _("Cannot get message: %s\n %s"),
+ name, _("Invalid message contents"));
g_free(name);
camel_object_unref((CamelObject *)message_stream);
camel_object_unref((CamelObject *)message);
diff --git a/camel/providers/local/camel-mh-store.c b/camel/providers/local/camel-mh-store.c
index a92db83797..6c442d335b 100644
--- a/camel/providers/local/camel-mh-store.c
+++ b/camel/providers/local/camel-mh-store.c
@@ -200,7 +200,7 @@ get_folder(CamelStore * store, const char *folder_name, guint32 flags, CamelExce
if (errno != ENOENT) {
camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM,
_("Could not open folder `%s':\n%s"),
- folder_name, g_strerror(errno));
+ folder_name, g_strerror (errno));
g_free (name);
return NULL;
}
@@ -214,7 +214,7 @@ get_folder(CamelStore * store, const char *folder_name, guint32 flags, CamelExce
if (mkdir(name, 0700) != 0) {
camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM,
_("Could not create folder `%s':\n%s"),
- folder_name, g_strerror(errno));
+ folder_name, g_strerror (errno));
g_free (name);
return NULL;
}
@@ -248,9 +248,9 @@ static void delete_folder(CamelStore * store, const char *folder_name, CamelExce
/* remove folder directory - will fail if not empty */
name = g_strdup_printf("%s%s", CAMEL_LOCAL_STORE(store)->toplevel_dir, folder_name);
if (rmdir(name) == -1) {
- camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM,
- _("Could not delete folder `%s': %s"),
- folder_name, strerror(errno));
+ camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
+ _("Could not delete folder `%s': %s"),
+ folder_name, g_strerror (errno));
g_free(name);
return;
}
diff --git a/camel/providers/local/camel-mh-summary.c b/camel/providers/local/camel-mh-summary.c
index f809fa2601..25794fa258 100644
--- a/camel/providers/local/camel-mh-summary.c
+++ b/camel/providers/local/camel-mh-summary.c
@@ -174,7 +174,7 @@ static int camel_mh_summary_add(CamelLocalSummary *cls, const char *name, int fo
fd = open(filename, O_RDONLY);
if (fd == -1) {
- g_warning("Cannot summarise/index: %s: %s", filename, strerror(errno));
+ g_warning ("Cannot summarise/index: %s: %s", filename, strerror (errno));
g_free(filename);
return -1;
}
@@ -240,7 +240,9 @@ mh_summary_check(CamelLocalSummary *cls, CamelFolderChangeInfo *changeinfo, Came
no longer exist */
dir = opendir(cls->folder_path);
if (dir == NULL) {
- camel_exception_setv(ex, 1, _("Cannot open MH directory path: %s: %s"), cls->folder_path, strerror(errno));
+ camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
+ _("Cannot open MH directory path: %s: %s"),
+ cls->folder_path, g_strerror (errno));
return -1;
}
@@ -348,7 +350,7 @@ mh_summary_sync_message(CamelLocalSummary *cls, CamelMessageInfo *info, CamelExc
ret = -1;
}
} else {
- g_warning("sync can't create tmp file: %s", strerror(errno));
+ g_warning("sync can't create tmp file: %s", strerror (errno));
}
g_free(tmpname);
} else {
diff --git a/camel/providers/local/camel-spool-folder.c b/camel/providers/local/camel-spool-folder.c
index 8118468a60..d667310090 100644
--- a/camel/providers/local/camel-spool-folder.c
+++ b/camel/providers/local/camel-spool-folder.c
@@ -145,7 +145,9 @@ spool_lock(CamelLocalFolder *lf, CamelLockType type, CamelException *ex)
mf->lockfd = open(lf->folder_path, O_RDWR, 0);
if (mf->lockfd == -1) {
- camel_exception_setv(ex, 1, _("Cannot create folder lock on %s: %s"), lf->folder_path, strerror(errno));
+ camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
+ _("Cannot create folder lock on %s: %s"),
+ lf->folder_path, g_strerror (errno));
return -1;
}
diff --git a/camel/providers/local/camel-spool-store.c b/camel/providers/local/camel-spool-store.c
index dc35f75a2a..f2cbdd1e55 100644
--- a/camel/providers/local/camel-spool-store.c
+++ b/camel/providers/local/camel-spool-store.c
@@ -114,9 +114,9 @@ construct (CamelService *service, CamelSession *session, CamelProvider *provider
}
if (stat(service->url->path, &st) == -1) {
- camel_exception_setv(ex, CAMEL_EXCEPTION_STORE_NO_FOLDER,
- _("Spool `%s' cannot be opened: %s"),
- service->url->path, strerror(errno));
+ camel_exception_setv (ex, CAMEL_EXCEPTION_STORE_NO_FOLDER,
+ _("Spool `%s' cannot be opened: %s"),
+ service->url->path, g_strerror (errno));
return;
}
@@ -156,17 +156,18 @@ get_folder(CamelStore * store, const char *folder_name, guint32 flags, CamelExce
name = g_strdup_printf("%s%s", CAMEL_LOCAL_STORE(store)->toplevel_dir, folder_name);
if (stat(name, &st) == -1) {
if (errno != ENOENT) {
- camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM,
- _("Could not open folder `%s':\n%s"),
- folder_name, strerror(errno));
+ camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
+ _("Could not open folder `%s':\n%s"),
+ folder_name, g_strerror (errno));
} else if ((flags & CAMEL_STORE_FOLDER_CREATE) == 0) {
- camel_exception_setv(ex, CAMEL_EXCEPTION_STORE_NO_FOLDER,
- _("Folder `%s' does not exist."), folder_name);
+ camel_exception_setv (ex, CAMEL_EXCEPTION_STORE_NO_FOLDER,
+ _("Folder `%s' does not exist."),
+ folder_name);
} else {
- if (creat(name, 0600) == -1) {
- camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM,
- _("Could not create folder `%s':\n%s"),
- folder_name, strerror(errno));
+ if (creat (name, 0600) == -1) {
+ camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
+ _("Could not create folder `%s':\n%s"),
+ folder_name, g_strerror (errno));
} else {
folder = camel_spool_folder_new(store, folder_name, flags, ex);
}
@@ -278,9 +279,9 @@ static int scan_dir(CamelStore *store, GHashTable *visited, char *root, const ch
name = root;
if (stat(name, &st) == -1) {
- camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM,
- _("Could not scan folder `%s': %s"),
- name, strerror(errno));
+ camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
+ _("Could not scan folder `%s': %s"),
+ name, g_strerror (errno));
} else if (S_ISREG(st.st_mode)) {
/* incase we start scanning from a file. messy duplication :-/ */
if (path) {
@@ -308,9 +309,9 @@ static int scan_dir(CamelStore *store, GHashTable *visited, char *root, const ch
dir = opendir(name);
if (dir == NULL) {
- camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM,
- _("Could not scan folder `%s': %s"),
- name, strerror(errno));
+ camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
+ _("Could not scan folder `%s': %s"),
+ name, g_strerror (errno));
return -1;
}
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;
}