summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Woodward2011-09-20 20:29:47 -0400
committerJason Woodward2011-09-20 20:29:47 -0400
commit71dcb01eb653108f89c7845c2d1b9e60d2d3e33b (patch)
tree0134452d9fd92a11a7d8ba7f95d86bd2f7d3d37b
parent44c0b4256d5e2f7852cf16343b88e6cc75f7c659 (diff)
downloadslapt-get-71dcb01eb653108f89c7845c2d1b9e60d2d3e33b.tar.gz
only create directory structure if chdir succeeded
-rw-r--r--src/configuration.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/configuration.c b/src/configuration.c
index 859dcb7..e829da9 100644
--- a/src/configuration.c
+++ b/src/configuration.c
@@ -149,7 +149,8 @@ void slapt_working_dir_init(const slapt_rc_config *global_config)
cwd = getcwd (NULL, 0);
if (cwd != NULL) {
r = chdir ("/");
- slapt_create_dir_structure (global_config->working_dir);
+ if (r == 0)
+ slapt_create_dir_structure (global_config->working_dir);
r = chdir (cwd);
free (cwd);
} else {