summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnand Avati <avati@redhat.com>2012-08-01 23:18:40 -0700
committerAnand Avati <avati@redhat.com>2012-08-02 13:22:28 -0700
commita3072499338b2d86f5cc3ac83f49c5249dc97778 (patch)
tree3aa872ea29631890f88f6a9bd70efad9fa741cc4
parenta9e3e24dd3c1afe7cb573b653040478a0f1210e6 (diff)
gfapi: set errno in glfs_init()
save errno from glfs_init_done and set it in glfs_init_wait() Change-Id: I1a2f43a7e7b0f07f279c175df987ff94d642b629 BUG: 839950 Signed-off-by: Anand Avati <avati@redhat.com> Reviewed-on: http://review.gluster.com/3771 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amarts@redhat.com>
-rw-r--r--api/src/glfs-internal.h1
-rw-r--r--api/src/glfs.c2
2 files changed, 3 insertions, 0 deletions
diff --git a/api/src/glfs-internal.h b/api/src/glfs-internal.h
index 0d67b6e249d..6380cd2ae2b 100644
--- a/api/src/glfs-internal.h
+++ b/api/src/glfs-internal.h
@@ -30,6 +30,7 @@ struct glfs {
pthread_cond_t cond;
int init;
int ret;
+ int err;
xlator_t *active_subvol;
diff --git a/api/src/glfs.c b/api/src/glfs.c
index af2378f77aa..017a55b1be8 100644
--- a/api/src/glfs.c
+++ b/api/src/glfs.c
@@ -460,6 +460,7 @@ glfs_init_wait (struct glfs *fs)
pthread_cond_wait (&fs->cond,
&fs->mutex);
ret = fs->ret;
+ errno = fs->err;
}
pthread_mutex_unlock (&fs->mutex);
@@ -479,6 +480,7 @@ glfs_init_done (struct glfs *fs, int ret)
{
fs->init = 1;
fs->ret = ret;
+ fs->err = errno;
pthread_cond_broadcast (&fs->cond);
}