Skip to content

Commit

Permalink
Sadly, we can't change symlink mtimes
Browse files Browse the repository at this point in the history
  • Loading branch information
Alphix committed May 20, 2007
1 parent 5418f35 commit 885833e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions metastore.c
Expand Up @@ -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)) {
Expand Down

0 comments on commit 885833e

Please sign in to comment.