From b017bcb852e3549ba7dc1dc6d23e157178bb1305 Mon Sep 17 00:00:00 2001 From: Shehjar Tikoo Date: Thu, 1 Oct 2009 06:59:06 +0000 Subject: libglusterfsclient: Use setattr for chmod Signed-off-by: Anand V. Avati BUG: 146 (Add setattr FOP) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=146 --- libglusterfsclient/src/libglusterfsclient.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'libglusterfsclient') diff --git a/libglusterfsclient/src/libglusterfsclient.c b/libglusterfsclient/src/libglusterfsclient.c index dd75115be..b4e62e55c 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) -- cgit