aboutsummaryrefslogtreecommitdiffstats
path: root/camel/camel-io.c
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2003-06-12 04:36:06 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2003-06-12 04:36:06 +0800
commit65672ffc09eb33c2770b72695065f6834ce5dd34 (patch)
tree35dcd4b7fd74cdcb50abc58146fb5f41b0c89667 /camel/camel-io.c
parent67e26bcc8e9c00520c1314c39a69a9f5457b363e (diff)
downloadgsoc2013-evolution-65672ffc09eb33c2770b72695065f6834ce5dd34.tar
gsoc2013-evolution-65672ffc09eb33c2770b72695065f6834ce5dd34.tar.gz
gsoc2013-evolution-65672ffc09eb33c2770b72695065f6834ce5dd34.tar.bz2
gsoc2013-evolution-65672ffc09eb33c2770b72695065f6834ce5dd34.tar.lz
gsoc2013-evolution-65672ffc09eb33c2770b72695065f6834ce5dd34.tar.xz
gsoc2013-evolution-65672ffc09eb33c2770b72695065f6834ce5dd34.tar.zst
gsoc2013-evolution-65672ffc09eb33c2770b72695065f6834ce5dd34.zip
some days you just wish you had that subatomic 100 megaton kill-o-zap bomb.
2003-06-04 Jeffrey Stedfast <fejj@ximian.com> * camel-uid-cache.c (camel_uid_cache_new): Create the directory with mode 0777 and the cache file itself with mode 0666. Let the user's umask filter the permissions. Instead of saving the fd on the Cache object, instead save the filename. Use camel_read() instead of expecting read() to just always work without getting an EINTR/etc. (maybe_write_uid): Don't do anything if cache->fd == -1, this means an error has occured in a previous callback. Replace the 2 calls to write() with camel_write() and check their return values. If either of them fails, set cache->fd to -1 (GHashTable doesn't give us a way to abort foreach'ing thru the table). (camel_uid_cache_save): Save to a temp file instead of overwriting the original. Do proper error checking, etc. Also added some smarts about whether to try and overwrite the old cache even if we haven't successfully saved all the uids in the cache. (camel_uid_cache_destroy): Free the cache->filename, no longer need to close (cache->fd). svn path=/trunk/; revision=21416
Diffstat (limited to 'camel/camel-io.c')
-rw-r--r--camel/camel-io.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/camel/camel-io.c b/camel/camel-io.c
index 88ddcf692d..df831162ba 100644
--- a/camel/camel-io.c
+++ b/camel/camel-io.c
@@ -35,6 +35,10 @@
#include "camel-operation.h"
+#ifndef MAX
+#define MAX(a,b) ((a) > (b) ? (a) : (b))
+#endif
+
/* FIXME: should we trade out select() for a poll() instead? */
ssize_t