aboutsummaryrefslogtreecommitdiffstats
path: root/camel
diff options
context:
space:
mode:
authorNot Zed <NotZed@Ximian.com>2002-09-26 13:56:12 +0800
committerMichael Zucci <zucchi@src.gnome.org>2002-09-26 13:56:12 +0800
commit3cb66ed22a86f8e193f4a28cb8cc3ddd31f427bd (patch)
tree4e71c3547df2715e0aacdc031c06d2cc06967e47 /camel
parenta007d6d2084df436d5f1fa2b6804064c6e7c62e0 (diff)
downloadgsoc2013-evolution-3cb66ed22a86f8e193f4a28cb8cc3ddd31f427bd.tar
gsoc2013-evolution-3cb66ed22a86f8e193f4a28cb8cc3ddd31f427bd.tar.gz
gsoc2013-evolution-3cb66ed22a86f8e193f4a28cb8cc3ddd31f427bd.tar.bz2
gsoc2013-evolution-3cb66ed22a86f8e193f4a28cb8cc3ddd31f427bd.tar.lz
gsoc2013-evolution-3cb66ed22a86f8e193f4a28cb8cc3ddd31f427bd.tar.xz
gsoc2013-evolution-3cb66ed22a86f8e193f4a28cb8cc3ddd31f427bd.tar.zst
gsoc2013-evolution-3cb66ed22a86f8e193f4a28cb8cc3ddd31f427bd.zip
Treat spool as a local folder, so the ref checks work right.
2002-09-26 Not Zed <NotZed@Ximian.com> * tests/folder/test2.c (main): Treat spool as a local folder, so the ref checks work right. * providers/local/camel-spool-store.c (get_folder): Use creat() instead of open() to create file. svn path=/trunk/; revision=18231
Diffstat (limited to 'camel')
-rw-r--r--camel/ChangeLog4
-rw-r--r--camel/providers/local/camel-spool-store.c4
-rw-r--r--camel/tests/folder/test2.c2
3 files changed, 6 insertions, 4 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog
index ab75d5d5df..db2bf38a88 100644
--- a/camel/ChangeLog
+++ b/camel/ChangeLog
@@ -1,5 +1,8 @@
2002-09-26 Not Zed <NotZed@Ximian.com>
+ * tests/folder/test2.c (main): Treat spool as a local folder, so
+ the ref checks work right.
+
* providers/local/camel-spool-store.c (get_folder): Implement
FOLDER_CREATE flag.
(scan_dir): Dont free name on exception, its alloca'd.
@@ -7,6 +10,7 @@
directly.
(scan_dir): Allow empty files to also show up in folder list, as
well as files starting with "From ".
+ (get_folder): Use creat() instead of open() to create file.
* providers/local/camel-spool-folder.c (camel_spool_folder_new):
Check folder != NULL before writing to it.
diff --git a/camel/providers/local/camel-spool-store.c b/camel/providers/local/camel-spool-store.c
index b1e7c7e091..dc35f75a2a 100644
--- a/camel/providers/local/camel-spool-store.c
+++ b/camel/providers/local/camel-spool-store.c
@@ -163,13 +163,11 @@ get_folder(CamelStore * store, const char *folder_name, guint32 flags, CamelExce
camel_exception_setv(ex, CAMEL_EXCEPTION_STORE_NO_FOLDER,
_("Folder `%s' does not exist."), folder_name);
} else {
- fd = open(name, O_CREAT, 0600);
- if (fd == -1) {
+ if (creat(name, 0600) == -1) {
camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM,
_("Could not create folder `%s':\n%s"),
folder_name, strerror(errno));
} else {
- close(fd);
folder = camel_spool_folder_new(store, folder_name, flags, ex);
}
}
diff --git a/camel/tests/folder/test2.c b/camel/tests/folder/test2.c
index afd35b1704..57a449ff59 100644
--- a/camel/tests/folder/test2.c
+++ b/camel/tests/folder/test2.c
@@ -49,7 +49,7 @@ int main(int argc, char **argv)
/* create a pseudo-spool file, and check that */
creat("/tmp/camel-test/testbox", 0600);
- test_folder_message_ops(session, "spool:///tmp/camel-test/testbox", FALSE, "INBOX");
+ test_folder_message_ops(session, "spool:///tmp/camel-test/testbox", TRUE, "INBOX");
check_unref(session, 1);
camel_exception_free(ex);