From 0b82cc7a34271a145a45ff7f296304e19a9315cc Mon Sep 17 00:00:00 2001 From: Mike Kestner Date: Fri, 14 Mar 2003 17:19:25 +0000 Subject: use access() like camel 2003-03-14 Mike Kestner * gal/util/e-util.c (e_mkdir_hier): use access() like camel 2003-03-14 Mike Kestner * gal-view-collection.c (gal_view_collection_load): check failure on e_create_directory call and warn. * gal-view-instance.c (save_current_view): check for failure and warn. svn path=/trunk/; revision=20291 --- e-util/e-util.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'e-util') 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; } -- cgit v1.2.3