diff options
author | Raghavendra Bhat <raghavendrabhat@gluster.com> | 2010-03-25 02:14:42 +0000 |
---|---|---|
committer | Anand V. Avati <avati@dev.gluster.com> | 2010-03-25 01:11:18 -0700 |
commit | 731431c4016479fa810e62aff49e92f57513eb8d (patch) | |
tree | 475efcec0a6c2f035528b16c51056120536a0a2c /xlators/storage/posix/src | |
parent | bd1242b66da347e61db5f2e51638eca9e641b20d (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
Diffstat (limited to 'xlators/storage/posix/src')
-rw-r--r-- | xlators/storage/posix/src/posix.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/xlators/storage/posix/src/posix.c b/xlators/storage/posix/src/posix.c index 330fe80faad..64704c5d440 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; } |