diff options
author | David Härdeman <david@hardeman.nu> | 2007-05-21 00:45:17 +0200 |
---|---|---|
committer | David Härdeman <david@hardeman.nu> | 2007-05-21 00:45:17 +0200 |
commit | 885833eba00ab9759a167df3b6478e1f9d26b6a9 (patch) | |
tree | 59358fe9df162bfc7894b03648db3a93a96c9d9d | |
parent | 5418f35510c5dceb77ea5c75adaf7fb6b0050e44 (diff) |
Sadly, we can't change symlink mtimes
-rw-r--r-- | metastore.c | 6 |
1 files changed, 4 insertions, 2 deletions
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)) { |