summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd.c
diff options
context:
space:
mode:
authorVijay Bellur <vijay@gluster.com>2010-07-19 05:54:25 +0000
committerAnand V. Avati <avati@dev.gluster.com>2010-07-19 05:11:05 -0700
commita6b90707bf68fe62bf115cfb143d9df69627cb64 (patch)
tree86a98f2e31bd9ec3cdba8b05386ef2d928bc09ed /xlators/mgmt/glusterd/src/glusterd.c
parent87ec1b72dac8f50f9eb4ba3b127baca19993ae94 (diff)
Changes for volume commands
Signed-off-by: Vijay Bellur <vijay@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 1161 (gluster volume start command segfaults glusterd) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1161
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd.c')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd.c b/xlators/mgmt/glusterd/src/glusterd.c
index 8b8509d4c0b..3be035e63ac 100644
--- a/xlators/mgmt/glusterd/src/glusterd.c
+++ b/xlators/mgmt/glusterd/src/glusterd.c
@@ -170,7 +170,7 @@ init (xlator_t *this)
struct stat buf = {0,};
char *port_str = NULL;
int port_num = 0;
- char voldir [PATH_MAX];
+ char voldir [PATH_MAX] = {0,};
dir_data = dict_get (this->options, "working-directory");
@@ -199,7 +199,7 @@ init (xlator_t *this)
if ((-1 == ret) && (ENOENT == errno)) {
- ret = mkdir (dirname, 0644);
+ ret = mkdir (dirname, 0777);
if (-1 == ret) {
gf_log (this->name, GF_LOG_CRITICAL,
@@ -213,9 +213,9 @@ init (xlator_t *this)
snprintf (voldir, PATH_MAX, "%s/vols", dirname);
- ret = mkdir (voldir, 0644);
+ ret = mkdir (voldir, 0777);
- if (-1 == ret) {
+ if ((-1 == ret) && (errno != EEXIST)) {
gf_log (this->name, GF_LOG_CRITICAL,
"Unable to create volume directory %s"
" ,errno = %d", voldir, errno);
@@ -260,6 +260,7 @@ init (xlator_t *this)
GF_VALIDATE_OR_GOTO(this->name, conf, out);
INIT_LIST_HEAD (&conf->peers);
INIT_LIST_HEAD (&conf->volumes);
+ INIT_LIST_HEAD (&conf->hostnames);
pthread_mutex_init (&conf->mutex, NULL);
conf->rpc = rpc;
conf->mgmt = &glusterd3_1_mgmt_prog;