If CAMEL_DEBUG is defined, print some useful ref/unref info.
2001-10-16 Jeffrey Stedfast <fejj@ximian.com> * camel-object.[c,h]: If CAMEL_DEBUG is defined, print some useful ref/unref info. * providers/imap/camel-imap-store.c (delete_folder): Fixed an assignment warning. * camel-uid-cache.c (camel_uid_cache_new): Make sure that the parent directory exists before trying to open the filename, if it doesn't, create it. svn path=/trunk/; revision=13707
This commit is contained in:
committed by
Jeffrey Stedfast
parent
700863d703
commit
fac0dbd69c
@ -1,3 +1,15 @@
|
||||
2001-10-16 Jeffrey Stedfast <fejj@ximian.com>
|
||||
|
||||
* camel-object.[c,h]: If CAMEL_DEBUG is defined, print some useful
|
||||
ref/unref info.
|
||||
|
||||
* providers/imap/camel-imap-store.c (delete_folder): Fixed an
|
||||
assignment warning.
|
||||
|
||||
* camel-uid-cache.c (camel_uid_cache_new): Make sure that the
|
||||
parent directory exists before trying to open the filename, if it
|
||||
doesn't, create it.
|
||||
|
||||
2001-10-16 <NotZed@Ximian.com>
|
||||
|
||||
* camel-mime-utils.c (header_address_decode): If no content, dont
|
||||
|
||||
@ -478,6 +478,10 @@ camel_object_new (CamelType type)
|
||||
return instance;
|
||||
}
|
||||
|
||||
#ifdef camel_object_ref
|
||||
#undef camel_object_ref
|
||||
#endif
|
||||
|
||||
void
|
||||
camel_object_ref (CamelObject * obj)
|
||||
{
|
||||
@ -488,6 +492,10 @@ camel_object_ref (CamelObject * obj)
|
||||
G_UNLOCK (refcount);
|
||||
}
|
||||
|
||||
#ifdef camel_object_unref
|
||||
#undef camel_object_unref
|
||||
#endif
|
||||
|
||||
void
|
||||
camel_object_unref (CamelObject * obj)
|
||||
{
|
||||
|
||||
@ -116,8 +116,15 @@ const gchar *camel_type_to_name (CamelType type);
|
||||
|
||||
CamelType camel_object_get_type (void);
|
||||
CamelObject *camel_object_new (CamelType type);
|
||||
void camel_object_ref (CamelObject * obj);
|
||||
void camel_object_unref (CamelObject * obj);
|
||||
|
||||
void camel_object_ref (CamelObject *obj);
|
||||
void camel_object_unref (CamelObject *obj);
|
||||
|
||||
#ifdef CAMEL_DEBUG
|
||||
#define camel_object_ref(o) (printf("%s (%s:%d):ref (%p)\n", __FUNCTION__, __FILE__, __LINE__, o), camel_object_ref(o))
|
||||
#define camel_object_unref(o) (printf("%s (%s:%d):unref (%p)\n", __FUNCTION__, __FILE__, __LINE__, o), camel_object_unref (o))
|
||||
#endif
|
||||
|
||||
CamelObject *camel_object_check_cast (CamelObject * obj,
|
||||
CamelType ctype);
|
||||
CamelObjectClass *camel_object_class_check_cast (CamelObjectClass *
|
||||
|
||||
@ -500,7 +500,6 @@ ssl_cert_is_saved (const char *certid)
|
||||
{
|
||||
char *filename;
|
||||
struct stat st;
|
||||
int ret;
|
||||
|
||||
filename = g_strdup_printf ("%s/.camel_certs/%s", getenv ("HOME"), certid);
|
||||
|
||||
|
||||
@ -43,6 +43,31 @@ struct _uid_state {
|
||||
static void free_uid (gpointer key, gpointer value, gpointer data);
|
||||
static void maybe_write_uid (gpointer key, gpointer value, gpointer data);
|
||||
|
||||
|
||||
static int
|
||||
mkdir_heir (const char *path, mode_t mode)
|
||||
{
|
||||
char *copy, *p;
|
||||
|
||||
p = copy = g_strdup (path);
|
||||
do {
|
||||
p = strchr (p + 1, '/');
|
||||
if (p)
|
||||
*p = '\0';
|
||||
if (access (copy, F_OK) == -1) {
|
||||
if (mkdir (copy, mode) == -1) {
|
||||
g_free (copy);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
if (p)
|
||||
*p = '/';
|
||||
} while (p);
|
||||
|
||||
g_free (copy);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* camel_uid_cache_new:
|
||||
* @filename: path to load the cache from
|
||||
@ -58,9 +83,13 @@ camel_uid_cache_new (const char *filename)
|
||||
{
|
||||
CamelUIDCache *cache;
|
||||
struct stat st;
|
||||
char *buf, **uids;
|
||||
char *dirname, *buf, **uids;
|
||||
int fd, i;
|
||||
|
||||
dirname = g_dirname (filename);
|
||||
mkdir_heir (dirname, 0700);
|
||||
g_free (dirname);
|
||||
|
||||
fd = open (filename, O_RDWR | O_CREAT, 0700);
|
||||
if (fd == -1)
|
||||
return NULL;
|
||||
|
||||
@ -1046,7 +1046,7 @@ delete_folder (CamelStore *store, const char *folder_name, CamelException *ex)
|
||||
char *journal_file;
|
||||
char *folder_dir;
|
||||
CamelFolderInfo *fi;
|
||||
char *name;
|
||||
const char *name;
|
||||
|
||||
folder_dir = e_path_to_physical (imap_store->storage_path, folder_name);
|
||||
if (access (folder_dir, F_OK) != 0) {
|
||||
|
||||
Reference in New Issue
Block a user