summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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)