summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAmar Tumballi <amar@gluster.com>2011-02-16 01:48:03 +0000
committerAnand V. Avati <avati@dev.gluster.com>2011-02-15 23:52:25 -0800
commit26cedae57d5b7cb8d50ed077ce29c92e30d6e260 (patch)
treee17297417df099c37a9152223f0d0e8f30cfd2ea
parent3f0525e65e7eb1d48610f13152b676dd6d9208f5 (diff)
glusterd-volgen: fix a issue of wrongly closing '0' fd.
Signed-off-by: Amar Tumballi <amar@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 2421 ([glusterfs-3.1.2gsync10]: epoll_create returning 0) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2421
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-volgen.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-volgen.c b/xlators/mgmt/glusterd/src/glusterd-volgen.c
index 4de6263629d..2933b1d8b7a 100644
--- a/xlators/mgmt/glusterd/src/glusterd-volgen.c
+++ b/xlators/mgmt/glusterd/src/glusterd-volgen.c
@@ -1474,14 +1474,17 @@ generate_brick_volfiles (glusterd_volinfo_t *volinfo)
if (marker) {
ret = open (tstamp_file, O_WRONLY|O_CREAT|O_EXCL, 0644);
- if (ret == -1 && errno == EEXIST)
- ret = 0;
+ if (ret == -1 && errno == EEXIST) {
+ gf_log ("", GF_LOG_DEBUG, "timestamp file exist");
+ ret = -2;
+ }
if (ret == -1) {
gf_log ("", GF_LOG_ERROR, "failed to create %s (%s)",
tstamp_file, strerror (errno));
return -1;
}
- close (ret);
+ if (ret >= 0)
+ close (ret);
} else {
ret = unlink (tstamp_file);
if (ret == -1 && errno == ENOENT)