From 885833eba00ab9759a167df3b6478e1f9d26b6a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20H=C3=A4rdeman?= Date: Mon, 21 May 2007 00:45:17 +0200 Subject: Sadly, we can't change symlink mtimes --- metastore.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'metastore.c') diff --git a/metastore.c b/metastore.c index 4408cda..25890d1 100644 --- a/metastore.c +++ b/metastore.c @@ -157,10 +157,12 @@ compare_fix(struct metaentry *real, struct metaentry *stored, int cmp) msg(MSG_DEBUG, "\tchmod failed: %s\n", strerror(errno)); } - if (cmp & DIFF_MTIME) { + /* FIXME: Use utimensat here, or even better - lutimensat */ + if ((cmp & DIFF_MTIME) && S_ISLNK(real->mode)) { + msg(MSG_NORMAL, "%s:\tsymlink, not changing mtime", real-path); + } else if (cmp & DIFF_MTIME) { msg(MSG_NORMAL, "%s:\tchanging mtime from %ld to %ld\n", real->path, real->mtime, stored->mtime); - /* FIXME: Use utimensat here */ tbuf.actime = stored->mtime; tbuf.modtime = stored->mtime; if (utime(real->path, &tbuf)) { -- cgit v1.2.1