summaryrefslogtreecommitdiffstats
path: root/build-aux/pkg-version
diff options
context:
space:
mode:
authorRinku Kothiya <rkothiya@redhat.com>2019-10-10 10:20:30 +0000
committerRinku Kothiya <rkothiya@redhat.com>2019-10-10 10:24:43 +0000
commita92e9e8e8ae6b97db8e0c1fb8268aef734ab48b4 (patch)
tree9641917a6c4db7a6755826bd78c2a91bb6278ecb /build-aux/pkg-version
parentbac5d7d60d14a190217fcd84fd0803a4d6a2e37d (diff)
doc: Updated release notes for release-7v7.0
updates: bz#1732875 Change-Id: Ie2fa04a76a1e36addff5f6bd6bd6b88aad2f948a Signed-off-by: Rinku Kothiya <rkothiya@redhat.com>
Diffstat (limited to 'build-aux/pkg-version')
0 files changed, 0 insertions, 0 deletions
/a>64
-rwxr-xr-xlibglusterfsclient/src/libglusterfsclient.h14
2 files changed, 78 insertions, 0 deletions
diff --git a/libglusterfsclient/src/libglusterfsclient.c b/libglusterfsclient/src/libglusterfsclient.c
index 58803e8933b..dcfda772e11 100755
--- a/libglusterfsclient/src/libglusterfsclient.c
+++ b/libglusterfsclient/src/libglusterfsclient.c
@@ -7843,6 +7843,70 @@ out:
}
+char *
+glusterfs_getcwd (char *buf, size_t size)
+{
+ char *res = NULL;
+ size_t len = 0;
+ loc_t loc = {0, };
+ glusterfs_handle_t handle = NULL;
+ char vpath[PATH_MAX];
+ int32_t op_ret = 0;
+
+ pthread_mutex_lock (&cwdlock);
+ {
+ if (!cwd_inited) {
+ errno = ENODEV;
+ goto unlock;
+ }
+
+ if (buf == NULL) {
+ buf = CALLOC (1, len);
+ if (buf == NULL) {
+ gf_log (LIBGF_XL_NAME, GF_LOG_ERROR,
+ "out of memory");
+ goto unlock;
+ }
+ } else {
+ if (size == 0) {
+ errno = EINVAL;
+ goto unlock;
+ }
+
+ if (len > size) {
+ errno = ERANGE;
+ goto unlock;
+ }
+ }
+
+ strcpy (buf, cwd);
+ res = buf;
+ }
+unlock:
+ pthread_mutex_unlock (&cwdlock);
+
+ if (res != NULL) {
+ handle = libgf_resolved_path_handle (res, vpath);
+
+ if (handle != NULL) {
+ loc.path = strdup (vpath);
+ if (loc.path == NULL) {
+ gf_log (LIBGF_XL_NAME, GF_LOG_ERROR,
+ "strdup failed");
+ } else {
+ op_ret = libgf_client_path_lookup (&loc, handle,
+ 0);
+ if (op_ret == -1) {
+ res = NULL;
+ }
+ }
+ }
+ }
+
+ return res;
+}<