aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--e-util/e-util.c7
-rw-r--r--widgets/menus/gal-view-collection.c7
-rw-r--r--widgets/menus/gal-view-instance.c4
3 files changed, 10 insertions, 8 deletions
diff --git a/e-util/e-util.c b/e-util/e-util.c
index 6c50331011..b830f654ee 100644
--- a/e-util/e-util.c
+++ b/e-util/e-util.c
@@ -275,11 +275,8 @@ e_mkdir_hier(const char *path, mode_t mode)
p = strchr (p + 1, '/');
if (p)
*p = '\0';
- if (mkdir (copy, mode) == -1) {
- switch (errno) {
- case EEXIST:
- break;
- default:
+ if (access (copy, F_OK) == -1) {
+ if (mkdir (copy, mode) == -1) {
g_free (copy);
return -1;
}
diff --git a/widgets/menus/gal-view-collection.c b/widgets/menus/gal-view-collection.c
index b7a571132e..87ac878b83 100644
--- a/widgets/menus/gal-view-collection.c
+++ b/widgets/menus/gal-view-collection.c
@@ -26,6 +26,7 @@
#include <util/e-i18n.h>
#include <ctype.h>
#include <string.h>
+#include <errno.h>
#include <libxml/parser.h>
#include <libgnome/gnome-util.h>
#include <gal/util/e-util.h>
@@ -469,7 +470,8 @@ gal_view_collection_load (GalViewCollection *collection)
g_return_if_fail (collection->system_dir != NULL);
g_return_if_fail (!collection->loaded);
- e_create_directory(collection->local_dir);
+ if ((e_create_directory(collection->local_dir) == -1) && (errno != EEXIST))
+ g_warning ("Unable to create dir %s: %s", collection->local_dir, g_strerror(errno));
load_single_dir(collection, collection->local_dir, TRUE);
load_single_dir(collection, collection->system_dir, FALSE);
@@ -537,7 +539,8 @@ gal_view_collection_save (GalViewCollection *collection)
e_xml_set_string_prop_by_name(child, "type", item->type);
}
filename = g_concat_dir_and_file(collection->local_dir, "galview.xml");
- e_xml_save_file (filename, doc);
+ if (e_xml_save_file (filename, doc) == -1)
+ g_warning ("Unable to save view to %s - %s", filename, g_strerror(errno));
xmlFreeDoc(doc);
g_free(filename);
}
diff --git a/widgets/menus/gal-view-instance.c b/widgets/menus/gal-view-instance.c
index cda202f552..c26eadb5df 100644
--- a/widgets/menus/gal-view-instance.c
+++ b/widgets/menus/gal-view-instance.c
@@ -26,6 +26,7 @@
#include <util/e-i18n.h>
#include <ctype.h>
#include <string.h>
+#include <errno.h>
#include <libxml/parser.h>
#include <libgnome/gnome-util.h>
#include <gal/util/e-util.h>
@@ -92,7 +93,8 @@ save_current_view (GalViewInstance *instance)
if (instance->current_type)
e_xml_set_string_prop_by_name (root, "current_view_type", instance->current_type);
- e_xml_save_file (instance->current_view_filename, doc);
+ if (e_xml_save_file (instance->current_view_filename, doc) == -1)
+ g_warning ("Unable to save view to %s - %s", instance->current_view_filename, g_strerror(errno));
xmlFreeDoc(doc);
}