- else if (sxp != &sx2)
- memcpy(&sx2.st, &sxp->st, sizeof (sx2.st));
- if (!atimes_ndx || S_ISDIR(sxp->st.st_mode))
- flags |= ATTRS_SKIP_ATIME;
- /* Don't set the creation date on the root folder of an HFS+ volume. */
- if (sxp->st.st_ino == 2 && S_ISDIR(sxp->st.st_mode))
- flags |= ATTRS_SKIP_CRTIME;
+ else {
+ if (!preserve_mtimes)
+ flags |= ATTRS_SKIP_MTIME;
+ if (!atimes_ndx || S_ISDIR(sxp->st.st_mode))
+ flags |= ATTRS_SKIP_ATIME;
+ /* Don't set the creation date on the root folder of an HFS+ volume. */
+ if (sxp->st.st_ino == 2 && S_ISDIR(sxp->st.st_mode))
+ flags |= ATTRS_SKIP_CRTIME;
+ }
+ if (sxp != &sx2)
+ memcpy(&sx2.st, &sxp->st, sizeof sx2.st);