From 58de6763b59005f231688cdd60dbb1a807c64283 Mon Sep 17 00:00:00 2001 From: Raghavendra Bhat Date: Wed, 24 Mar 2010 04:42:34 +0000 Subject: 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 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 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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; } -- cgit