From 731431c4016479fa810e62aff49e92f57513eb8d Mon Sep 17 00:00:00 2001 From: Raghavendra Bhat Date: Thu, 25 Mar 2010 02:14:42 +0000 Subject: 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 Signed-off-by: Anand V. Avati BUG: 34 (No such file or directory on du) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=34 --- xlators/storage/posix/src/posix.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'xlators/storage/posix/src/posix.c') 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; } -- cgit