summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAmar Tumballi <amar@gluster.com>2011-03-14 05:36:16 +0000
committerVijay Bellur <vijay@dev.gluster.com>2011-03-14 10:41:46 -0700
commitda57b8e7541ced2be0464f461e29dc7428bbcb14 (patch)
tree1b89c71a91038ad4995bc9ba2e6d76f48c143d80
parentc886643f97373944030c118b7f78d0a8c06b2291 (diff)
used S_ISVTX instead of 01000 in code for sticky bit check
Signed-off-by: Amar Tumballi <amar@gluster.com> Signed-off-by: Vijay Bellur <vijay@dev.gluster.com> BUG: 2369 () URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2369
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-rebalance.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-rebalance.c b/xlators/mgmt/glusterd/src/glusterd-rebalance.c
index d69f59eab11..a3556c19e60 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",