summaryrefslogtreecommitdiffstats
path: root/booster
diff options
context:
space:
mode:
authorShehjar Tikoo <shehjart@zresearch.com>2009-05-05 16:01:16 +0530
committerAnand V. Avati <avati@amp.gluster.com>2009-05-05 17:45:21 +0530
commit76aa5e491dc3577bf8471cb649fee7b3d0a3dc9d (patch)
treecb66cc473d049e94ec655bf5368d9569f6759e6e /booster
parent93c3a887695fc4fa7a65d6556398cffcf22d099e (diff)
booster: Add rmdir API
Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
Diffstat (limited to 'booster')
-rw-r--r--booster/src/booster.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/booster/src/booster.c b/booster/src/booster.c
index e91f6c30c..fd155581a 100644
--- a/booster/src/booster.c
+++ b/booster/src/booster.c
@@ -149,6 +149,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);
#define RESOLVE(sym) do { \
if (!real_##sym) \
@@ -1025,6 +1026,23 @@ mkdir (const char *pathname, mode_t mode)
return ret;
}
+int
+rmdir (const char *pathname)
+{
+ int ret = -1;
+
+ ret = glusterfs_rmdir (pathname);
+ if (((ret == -1) && (errno != ENODEV)) || (ret == 0))
+ return ret;
+
+ if (real_rmdir == NULL) {
+ errno = ENOSYS;
+ ret = -1;
+ } else
+ ret = real_rmdir (pathname);
+
+ return ret;
+}
#define MOUNT_TABLE_HASH_SIZE 256
@@ -1196,6 +1214,7 @@ _init (void)
RESOLVE (fork);
RESOLVE (mkdir);
+ RESOLVE (rmdir);
/* This must be called after resolving real functions
* above so that the socket based IO calls in libglusterfsclient