diff options
author | Shehjar Tikoo <shehjart@zresearch.com> | 2009-05-05 16:02:55 +0530 |
---|---|---|
committer | Anand V. Avati <avati@amp.gluster.com> | 2009-05-05 17:46:38 +0530 |
commit | 48e30d6715574c34bc760798e1657b5900129c25 (patch) | |
tree | bb9e25936b659c0b92c0df20a8b4ef643fac7d43 | |
parent | 62b29b0db6f7d417a3281c3937bd5af20e1bf201 (diff) |
booster: Add unlink API
Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
-rw-r--r-- | booster/src/booster.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/booster/src/booster.c b/booster/src/booster.c index a14fb799d2b..64d769da319 100644 --- a/booster/src/booster.c +++ b/booster/src/booster.c @@ -163,6 +163,7 @@ static int (*real_utimes) (const char *path, const struct timeval times[2]); static int (*real_utime) (const char *path, const struct utimbuf *buf); static int (*real_mknod) (const char *path, mode_t mode, dev_t dev); static int (*real_mkfifo) (const char *path, mode_t mode); +static int (*real_unlink) (const char *path); #define RESOLVE(sym) do { \ if (!real_##sym) \ @@ -1408,6 +1409,24 @@ mkfifo (const char *path, mode_t mode) return ret; } +int +unlink (const char *path) +{ + int ret = -1; + + ret = glusterfs_unlink (path); + if (((ret == -1) && (errno != ENODEV)) || (ret == 0)) + return ret; + + if (real_unlink == NULL) { + errno = ENOSYS; + ret = -1; + } else + ret = real_unlink (path); + + return ret; +} + pid_t fork (void) { @@ -1471,6 +1490,7 @@ _init (void) RESOLVE (utime); RESOLVE (mknod); RESOLVE (mkfifo); + RESOLVE (unlink); /* This must be called after resolving real functions * above so that the socket based IO calls in libglusterfsclient |