summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaghavendra Bhat <raghavendrabhat@gluster.com>2010-03-25 02:14:42 +0000
committerAnand V. Avati <avati@dev.gluster.com>2010-03-25 01:11:18 -0700
commit731431c4016479fa810e62aff49e92f57513eb8d (patch)
tree475efcec0a6c2f035528b16c51056120536a0a2c
parentbd1242b66da347e61db5f2e51638eca9e641b20d (diff)
fix utimes
Change utimes to lutimes to prevent errors from symbolic links for linux. 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.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/xlators/storage/posix/src/posix.c b/xlators/storage/posix/src/posix.c
index 330fe80fa..64704c5d4 100644
--- a/xlators/storage/posix/src/posix.c
+++ b/xlators/storage/posix/src/posix.c
@@ -629,8 +629,11 @@ posix_do_utimes (xlator_t *this,
tv[1].tv_sec = stbuf->ia_mtime;
tv[1].tv_usec = stbuf->ia_mtime_nsec / 1000;
- ret = utimes (path, tv);
-
+ ret = lutimes (path, tv);
+ if ((ret == -1) && (errno == ENOSYS)) {
+ ret = utimes (path, tv);
+ }
+
return ret;
}