From da57b8e7541ced2be0464f461e29dc7428bbcb14 Mon Sep 17 00:00:00 2001 From: Amar Tumballi Date: Mon, 14 Mar 2011 05:36:16 +0000 Subject: used S_ISVTX instead of 01000 in code for sticky bit check Signed-off-by: Amar Tumballi Signed-off-by: Vijay Bellur BUG: 2369 () URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2369 --- xlators/mgmt/glusterd/src/glusterd-rebalance.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'xlators/mgmt') diff --git a/xlators/mgmt/glusterd/src/glusterd-rebalance.c b/xlators/mgmt/glusterd/src/glusterd-rebalance.c index d69f59eab..a3556c19e 100644 --- a/xlators/mgmt/glusterd/src/glusterd-rebalance.c +++ b/xlators/mgmt/glusterd/src/glusterd-rebalance.c @@ -80,7 +80,7 @@ gf_glusterd_rebalance_move_data (glusterd_volinfo_t *volinfo, const char *dir) defrag->num_files_lookedup += 1; if (!(S_ISREG (stbuf.st_mode) && - ((stbuf.st_mode & 01000) == 01000))) + ((stbuf.st_mode & S_ISVTX) == S_ISVTX))) continue; /* If the file is open, don't run rebalance on it */ @@ -95,7 +95,7 @@ gf_glusterd_rebalance_move_data (glusterd_volinfo_t *volinfo, const char *dir) entry->d_name, (unsigned long long)stbuf.st_size); - dst_fd = creat (tmp_filename, (stbuf.st_mode & ~01000)); + dst_fd = creat (tmp_filename, (stbuf.st_mode & ~S_ISVTX)); if (dst_fd == -1) continue; @@ -130,7 +130,7 @@ gf_glusterd_rebalance_move_data (glusterd_volinfo_t *volinfo, const char *dir) continue; } - ret = fchmod (dst_fd, (stbuf.st_mode & ~01000)); + ret = fchmod (dst_fd, stbuf.st_mode & ~S_ISVTX); if (ret) { gf_log ("", GF_LOG_WARNING, "failed to set the mode of file %s: %s", -- cgit