aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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);