summaryrefslogtreecommitdiffstats
path: root/libglusterfsclient
diff options
context:
space:
mode:
authorShehjar Tikoo <shehjart@gluster.com>2009-10-01 06:59:06 +0000
committerAnand V. Avati <avati@dev.gluster.com>2009-10-01 07:23:57 -0700
commitb017bcb852e3549ba7dc1dc6d23e157178bb1305 (patch)
tree663ec2cf9c600a3b376769155369f2b8fc93007a /libglusterfsclient
parent709d46bcdbd006fa92c9d15e7c02ba7bff86685b (diff)
libglusterfsclient: Use setattr for chmod
Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 146 (Add setattr FOP) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=146
Diffstat (limited to 'libglusterfsclient')
-rwxr-xr-xlibglusterfsclient/src/libglusterfsclient.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/libglusterfsclient/src/libglusterfsclient.c b/libglusterfsclient/src/libglusterfsclient.c
index dd75115be3d..b4e62e55ced 100755
--- a/libglusterfsclient/src/libglusterfsclient.c
+++ b/libglusterfsclient/src/libglusterfsclient.c
@@ -5208,10 +5208,14 @@ glusterfs_glh_chmod (glusterfs_handle_t handle, const char *path, mode_t mode)
libglusterfs_client_ctx_t *ctx = handle;
loc_t loc = {0, };
char *name = NULL;
+ struct stat stbuf = {0,};
+ int32_t valid = 0;
GF_VALIDATE_OR_GOTO (LIBGF_XL_NAME, ctx, out);
GF_VALIDATE_ABSOLUTE_PATH_OR_GOTO (LIBGF_XL_NAME, path, out);
+ stbuf.st_mode = mode;
+ valid |= GF_SET_ATTR_MODE;
loc.path = libgf_resolve_path_light ((char *)path);
if (!loc.path) {
gf_log (LIBGF_XL_NAME, GF_LOG_ERROR, "Path compaction failed");
@@ -5230,7 +5234,7 @@ glusterfs_glh_chmod (glusterfs_handle_t handle, const char *path, mode_t mode)
goto out;
}
- op_ret = libgf_client_chmod (ctx, &loc, mode);
+ op_ret = libgf_client_setattr (ctx, &loc, &stbuf, valid);
out:
if (name)