summaryrefslogtreecommitdiffstats
path: root/libglusterfsclient/src/libglusterfsclient.c
diff options
context:
space:
mode:
authorShehjar Tikoo <shehjart@gluster.com>2009-10-01 06:59:14 +0000
committerAnand V. Avati <avati@dev.gluster.com>2009-10-01 07:24:26 -0700
commit1640178a1004cb5a43cdf2e5fb375807812f367f (patch)
tree1ae2d5711d0555c516cb29d877ae7ac49e17f613 /libglusterfsclient/src/libglusterfsclient.c
parent507a4aa75d295f6fa7db04885b65aec0f497b21e (diff)
libglusterfsclient: Use fsetattr for fchmod
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/src/libglusterfsclient.c')
-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 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;
}