summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaghavendra Bhat <raghavendrabhat@gluster.com>2010-03-24 04:42:34 +0000
committerAnand V. Avati <avati@dev.gluster.com>2010-03-25 01:11:22 -0700
commit58de6763b59005f231688cdd60dbb1a807c64283 (patch)
tree4e1e71f294eb77be9f6a1c7335ff6097decbfaa8
parentbb63408f73c5ad8ff89dfbaaee4b177fffb63bb2 (diff)
fix posix_utimes
change utimes to lutimes to prevent errors from symbolic links for linux systems. For non-linux systems keep utimes. Signed-off-by: Raghavendra Bhat <raghavendrabhat@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 34 (No such file or directory on du) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=34
-rw-r--r--xlators/storage/posix/src/posix.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/xlators/storage/posix/src/posix.c b/xlators/storage/posix/src/posix.c
index 0f784f28e97..1d21a63512d 100644
--- a/xlators/storage/posix/src/posix.c
+++ b/xlators/storage/posix/src/posix.c
@@ -619,7 +619,10 @@ posix_do_utimes (xlator_t *this,
tv[1].tv_sec = stbuf->st_mtime;
tv[1].tv_usec = ST_MTIM_NSEC (stbuf) / 1000;
- ret = utimes (path, tv);
+ ret = lutimes (path, tv);
+ if ((ret == -1) && (errno == ENOSYS)) {
+ ret = utimes (path, tv);
+ }
return ret;
}