From 1640178a1004cb5a43cdf2e5fb375807812f367f Mon Sep 17 00:00:00 2001 From: Shehjar Tikoo Date: Thu, 1 Oct 2009 06:59:14 +0000 Subject: libglusterfsclient: Use fsetattr for fchmod 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 d751a2e7bbc..b76e9171f7b 100755 --- a/libglusterfsclient/src/libglusterfsclient.c +++ b/libglusterfsclient/src/libglusterfsclient.c @@ -5557,6 +5557,8 @@ glusterfs_fchmod (glusterfs_file_t fd, mode_t mode) { libglusterfs_client_fd_ctx_t *fdctx = NULL; int op_ret = -1; + struct stat stbuf = {0,}; + int32_t valid = 0; GF_VALIDATE_OR_GOTO (LIBGF_XL_NAME, fd, out); fdctx = libgf_get_fd_ctx (fd); @@ -5567,8 +5569,10 @@ glusterfs_fchmod (glusterfs_file_t fd, mode_t mode) goto out; } - op_ret = libgf_client_fchmod (fdctx->ctx, fd, mode); + stbuf.st_mode = mode; + valid |= GF_SET_ATTR_MODE; + op_ret = libgf_client_fsetattr (fdctx->ctx, fd, &stbuf, valid); out: return op_ret; } -- cgit