diff options
author | Vijay Bellur <vijay@gluster.com> | 2010-07-14 00:20:28 +0000 |
---|---|---|
committer | Anand V. Avati <avati@dev.gluster.com> | 2010-07-14 14:44:18 -0700 |
commit | 32451a4dd02bdd95ec800d51267d2e6be43914a4 (patch) | |
tree | 6054625db937658faf1d451d4173a95fd76a8a86 /xlators/mgmt/glusterd/src/glusterd.c | |
parent | 9186c9e84c857a0b1bfbfa4e7b46e9eb741186fb (diff) |
Fixes a crash seen in create volume
Also includes some re-factoring changes.
Signed-off-by: Vijay Bellur <vijay@gluster.com>
Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
BUG: 1063 (gluster volume create command segfaults)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1063
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd.c')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd.c b/xlators/mgmt/glusterd/src/glusterd.c index 7ce466a64..436a8d4e1 100644 --- a/xlators/mgmt/glusterd/src/glusterd.c +++ b/xlators/mgmt/glusterd/src/glusterd.c @@ -170,6 +170,7 @@ init (xlator_t *this) struct stat buf = {0,}; char *port_str = NULL; int port_num = 0; + char voldir [PATH_MAX]; dir_data = dict_get (this->options, "working-directory"); @@ -210,6 +211,15 @@ init (xlator_t *this) gf_log (this->name, GF_LOG_NORMAL, "Using %s as working directory", dirname); + snprintf (voldir, PATH_MAX, "%s/vols", dirname); + + ret = mkdir (voldir, 0644); + + if (-1 == ret) { + gf_log (this->name, GF_LOG_CRITICAL, + "Unable to create volume directory %s" + " ,errno = %d", voldir, errno); + } rpc = rpcsvc_init (this->ctx, this->options); if (rpc == NULL) { |