aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <marco@gnome.org>2004-07-22 17:17:09 +0800
committerMarco Pesenti Gritti <marco@src.gnome.org>2004-07-22 17:17:09 +0800
commit8ed863129291204c3b293e41dae4bc3a1c7e9127 (patch)
treed68732b960661ad2a5a818320c02d946b8eeeae1 /lib
parent561c5a9432b239aee5581ef83b0f38c5eeecd30c (diff)
downloadgsoc2013-epiphany-8ed863129291204c3b293e41dae4bc3a1c7e9127.tar
gsoc2013-epiphany-8ed863129291204c3b293e41dae4bc3a1c7e9127.tar.gz
gsoc2013-epiphany-8ed863129291204c3b293e41dae4bc3a1c7e9127.tar.bz2
gsoc2013-epiphany-8ed863129291204c3b293e41dae4bc3a1c7e9127.tar.lz
gsoc2013-epiphany-8ed863129291204c3b293e41dae4bc3a1c7e9127.tar.xz
gsoc2013-epiphany-8ed863129291204c3b293e41dae4bc3a1c7e9127.tar.zst
gsoc2013-epiphany-8ed863129291204c3b293e41dae4bc3a1c7e9127.zip
Handle the case where the downloads dir cannot be created gracefully. Fix
2004-07-22 Marco Pesenti Gritti <marco@gnome.org> * doc/reference/tmpl/ephy-embed.sgml: * embed/mozilla/MozDownload.cpp: * lib/ephy-file-helpers.c: (ephy_ensure_dir_exists): * lib/ephy-file-helpers.h: Handle the case where the downloads dir cannot be created gracefully. Fix #146902
Diffstat (limited to 'lib')
-rw-r--r--lib/ephy-file-helpers.c14
-rw-r--r--lib/ephy-file-helpers.h2
2 files changed, 12 insertions, 4 deletions
diff --git a/lib/ephy-file-helpers.c b/lib/ephy-file-helpers.c
index 5b8dbc323..138d8719f 100644
--- a/lib/ephy-file-helpers.c
+++ b/lib/ephy-file-helpers.c
@@ -224,17 +224,25 @@ ephy_file_helpers_shutdown (void)
dot_dir = NULL;
}
-void
+gboolean
ephy_ensure_dir_exists (const char *dir)
{
if (g_file_test (dir, G_FILE_TEST_IS_DIR) == FALSE)
{
if (g_file_test (dir, G_FILE_TEST_EXISTS) == TRUE)
- g_error (_("%s exists, please move it out of the way."), dir);
+ {
+ g_warning (_("%s exists, please move it out of the way."), dir);
+ return FALSE;
+ }
if (mkdir (dir, 488) != 0)
- g_error (_("Failed to create directory %s."), dir);
+ {
+ g_warning (_("Failed to create directory %s."), dir);
+ return FALSE;
+ }
}
+
+ return TRUE;
}
static void
diff --git a/lib/ephy-file-helpers.h b/lib/ephy-file-helpers.h
index d399b4a5a..bfb7e1b6c 100644
--- a/lib/ephy-file-helpers.h
+++ b/lib/ephy-file-helpers.h
@@ -40,7 +40,7 @@ const char *ephy_file_tmp_dir (void);
char *ephy_file_tmp_filename (const char *base,
const char *extension);
-void ephy_ensure_dir_exists (const char *dir);
+gboolean ephy_ensure_dir_exists (const char *dir);
GSList *ephy_file_find (const char *path,
const char *fname,