summaryrefslogtreecommitdiffstats
path: root/booster
diff options
context:
space:
mode:
authorShehjar Tikoo <shehjart@zresearch.com>2009-05-05 16:01:24 +0530
committerAnand V. Avati <avati@amp.gluster.com>2009-05-05 17:45:25 +0530
commit13610ba31d3b5a60c4d03343438f696725558e65 (patch)
treec64182b5cd71d672ad795d859585c42f95c6560c /booster
parent76aa5e491dc3577bf8471cb649fee7b3d0a3dc9d (diff)
booster: Add chmod API
Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
Diffstat (limited to 'booster')
-rw-r--r--booster/src/booster.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/booster/src/booster.c b/booster/src/booster.c
index fd155581ae0..0c53b4f9c34 100644
--- a/booster/src/booster.c
+++ b/booster/src/booster.c
@@ -150,6 +150,7 @@ static int (*real_dup2) (int oldfd, int newfd);
static pid_t (*real_fork) (void);
static int (*real_mkdir) (const char *pathname, mode_t mode);
static int (*real_rmdir) (const char *pathname);
+static int (*real_chmod) (const char *pathname, mode_t mode);
#define RESOLVE(sym) do { \
if (!real_##sym) \
@@ -1044,6 +1045,24 @@ rmdir (const char *pathname)
return ret;
}
+int
+chmod (const char *pathname, mode_t mode)
+{
+ int ret = -1;
+
+ ret = glusterfs_chmod (pathname, mode);
+ if (((ret == -1) && (errno != ENODEV)) || (ret == 0))
+ return ret;
+
+ if (real_chmod == NULL) {
+ errno = ENOSYS;
+ ret = -1;
+ } else
+ ret = real_chmod (pathname, mode);
+
+ return ret;
+}
+
#define MOUNT_TABLE_HASH_SIZE 256
@@ -1215,6 +1234,7 @@ _init (void)
RESOLVE (fork);
RESOLVE (mkdir);
RESOLVE (rmdir);
+ RESOLVE (chmod);
/* This must be called after resolving real functions
* above so that the socket based IO calls in libglusterfsclient