diff options
author | Shehjar Tikoo <shehjart@zresearch.com> | 2009-05-05 16:02:24 +0530 |
---|---|---|
committer | Anand V. Avati <avati@amp.gluster.com> | 2009-05-05 17:46:06 +0530 |
commit | 48ee90ab87cf0c01fee0188728d70d67c6724b97 (patch) | |
tree | 703a0c31126757da875a4f2d998518747eda70d0 /booster/src | |
parent | acac22c87374310544b3a4bb301e9bfa3ea26001 (diff) |
booster: Add utimes API
Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
Diffstat (limited to 'booster/src')
-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 681423277c2..80bac3a2f00 100644 --- a/booster/src/booster.c +++ b/booster/src/booster.c @@ -158,6 +158,7 @@ static int (*real_fsync) (int fd); static int (*real_ftruncate) (int fd, off_t length); static int (*real_link) (const char *oldpath, const char *newname); static int (*real_rename) (const char *oldpath, const char *newpath); +static int (*real_utimes) (const char *path, const struct timeval times[2]); #define RESOLVE(sym) do { \ if (!real_##sym) \ @@ -1330,6 +1331,24 @@ rename (const char *old, const char *new) return ret; } +int +utimes (const char *path, const struct timeval times[2]) +{ + int ret = -1; + + ret = glusterfs_utimes (path, times); + if (((ret == -1) && (errno != ENODEV)) || (ret == 0)) + return ret; + + if (real_utimes == NULL) { + errno = ENOSYS; + ret = -1; + } else + ret = real_utimes (path, times); + + return ret; +} + pid_t fork (void) { @@ -1389,6 +1408,7 @@ _init (void) RESOLVE (ftruncate); RESOLVE (link); RESOLVE (rename); + RESOLVE (utimes); /* This must be called after resolving real functions * above so that the socket based IO calls in libglusterfsclient |