diff options
author | Vijay Bellur <vijay@gluster.com> | 2011-05-06 08:16:26 +0530 |
---|---|---|
committer | Vijay Bellur <vijay@gluster.com> | 2011-05-06 08:16:26 +0530 |
commit | eb19564ffffd7c26dc2ec8c0216b6cc2f50194b1 (patch) | |
tree | 166e033a51e498b0689e0c9e9a3f29072176e654 /xlators/storage | |
parent | 49e9a2dbd8acdf17905fb0646236ee6a11562f8b (diff) | |
parent | bf5c0efdec755297a976a6253665431d700d0737 (diff) |
Merge branch 'release-3.0' of github.com:gluster/glusterfs into release-3.0
Diffstat (limited to 'xlators/storage')
-rw-r--r-- | xlators/storage/posix/src/posix.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/xlators/storage/posix/src/posix.c b/xlators/storage/posix/src/posix.c index 0000973c2..10c8ec81c 100644 --- a/xlators/storage/posix/src/posix.c +++ b/xlators/storage/posix/src/posix.c @@ -634,6 +634,18 @@ posix_do_utimes (xlator_t *this, { int32_t ret = -1; struct timeval tv[2] = {{0,},{0,}}; + struct stat stat; + int is_symlink = 0; + + ret = sys_lstat (path, &stat); + if (ret != 0) { + gf_log (this->name, GF_LOG_WARNING, + "%s (%s)", path, strerror (errno)); + goto out; + } + + if (S_ISLNK (stat.st_mode)) + is_symlink = 1; tv[0].tv_sec = stbuf->st_atime; tv[0].tv_usec = ST_ATIM_NSEC (stbuf) / 1000; @@ -642,9 +654,14 @@ posix_do_utimes (xlator_t *this, ret = lutimes (path, tv); if ((ret == -1) && (errno == ENOSYS)) { + if (is_symlink) { + ret = 0; + goto out; + } ret = utimes (path, tv); } +out: return ret; } |